Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > checkboxes! URGENT

Reply
Thread Tools

checkboxes! URGENT

 
 
VbUser25
Guest
Posts: n/a
 
      01-06-2005


hi
i need urgent responses..

i have some 15 checkboxex on a form... i want to 1st check the no. of
checkboxes that are checked?? and then loop it that many times adn
insert the quantities the user enters in the text boxes.

do i need to group the checkboxes....hwo can i do that??? how to know
which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th
are checked then i 1st need to get the id from the database adn then
based on htat id retrieved i need to insert values on another table.

pls suggest with a code.

thanks a lot


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Steven Burn
Guest
Posts: n/a
 
      01-06-2005
I'm sorry, everyone is busy dealing with other people's "urgent" demands,
please check back later.

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"VbUser25" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
>
>
> hi
> i need urgent responses..
>
> i have some 15 checkboxex on a form... i want to 1st check the no. of
> checkboxes that are checked?? and then loop it that many times adn
> insert the quantities the user enters in the text boxes.
>
> do i need to group the checkboxes....hwo can i do that??? how to know
> which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th
> are checked then i 1st need to get the id from the database adn then
> based on htat id retrieved i need to insert values on another table.
>
> pls suggest with a code.
>
> thanks a lot
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
 
Jeff Cochran
Guest
Posts: n/a
 
      01-06-2005
On Thu, 06 Jan 2005 00:48:26 -0800, VbUser25
<(E-Mail Removed)> wrote:

>i need urgent responses..


Usenet newsgroups aren't the best method for getting responses on your
time table. Most of us read these groups according to *our*
timetable.

>i have some 15 checkboxex on a form... i want to 1st check the no. of
>checkboxes that are checked?? and then loop it that many times adn
>insert the quantities the user enters in the text boxes.
>
>do i need to group the checkboxes....hwo can i do that??? how to know
>which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th
>are checked then i 1st need to get the id from the database adn then
>based on htat id retrieved i need to insert values on another table.


What's wrong with simply implementing a counter for whatever you want
to count?

>pls suggest with a code.


Pseudocode:

Counter = 0
If Checkbox1 = Checked Then
Counter = Counter + 1
End If
If Checkbox2 = Checked Then
Counter = Counter + 1
End If
If Checkbox3 = Checked Then
Counter = Counter + 1
End If
Response.Write Counter

You can recode this a dozen different ways in whatever method you
wish, the principal is to increment the counter for each response you
want to count.

Jeff
 
Reply With Quote
 
larrybud2002@yahoo.com
Guest
Posts: n/a
 
      01-06-2005

VbUser25 wrote:
> hi
> i need urgent responses..
>
> i have some 15 checkboxex on a form... i want to 1st check the no. of
> checkboxes that are checked?? and then loop it that many times adn
> insert the quantities the user enters in the text boxes.
>
> do i need to group the checkboxes....hwo can i do that??? how to know
> which checkbox is checked because out of the 15 checkbox say 1,5,7,

9th
> are checked then i 1st need to get the id from the database adn then
> based on htat id retrieved i need to insert values on another table.


Each checkbox should be named so it's unique, but you know that it's a
checkbox. For example, each name would begin with

checkbox_xxx

Where xxx is the checkbox # in sequential order, a primary key in a
table, etc... something to make it unique

When the form is submitted, do a for...each loop

for each element in request.form
if left(request.form(element),9)="checkbox_" then
checkboxvalue=request.form(element)
checkboxnum=right(element, len(element)-9)

if checkboxvalue="1" then
'your code for when the checkbox is checked goes here.
end if
end if
next

 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      01-06-2005
"VbUser25" wrote in message news:%(E-Mail Removed)...
:
: hi
: i need urgent responses..

don't we all?

: i have some 15 checkboxex on a form... i want to 1st check the no. of
: checkboxes that are checked?? and then loop it that many times adn
: insert the quantities the user enters in the text boxes.
:
: do i need to group the checkboxes....hwo can i do that??? how to know
: which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th
: are checked then i 1st need to get the id from the database adn then
: based on htat id retrieved i need to insert values on another table.

What you need is a spelling checker and for someone to do your homework.
This is an ASP NG, and you're requiring user intervention. That makes it a
client-side issue. If your form is submitted to the same page or another
then you use request.form to retrieve the values. This requires a
method="post" in your form. If you use method="get" you use
request.querystring on the server side.

You haven't stated which language you want to use or if a form is involved
to submit the form so it can be parsed, evaluated and processed. All of
this could be done on the client-side. You state you have check boxes and
suddenly text boxes appear in your message. You're not even sure how to
determine if a checkbox has been checked which means if you need that, you
need help no the client-side. ASP is server-side scripting.

Granted we all make spelling errors but yours are not spelling errors,
they're careless typing errors. If you do not show anymore care to solicit
help by correcting your errors, or at least making an attempt to, why should
we?

: pls suggest with a code.

Show us what you have so far as it will be easier to correct your code than
try to educate you on how it's done. Unless you're willing to pay, you're
going to miss your deadline. If it's homework, we'll help to point you to
the right material so you can educate yourself and get it written. Being
honest will get you more information although we won't do your homework for
you. If your goal is to just have someone do you work for you, then you're
in the wrong place and you've chosen the wrong career.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


 
Reply With Quote
 
dp
Guest
Posts: n/a
 
      01-08-2005
VbUser25 wrote:
> hi
> i need urgent responses..
>
> i have some 15 checkboxex on a form... i want to 1st check the no. of
> checkboxes that are checked?? and then loop it that many times adn
> insert the quantities the user enters in the text boxes.
>
> do i need to group the checkboxes....hwo can i do that??? how to know
> which checkbox is checked because out of the 15 checkbox say 1,5,7,
> 9th are checked then i 1st need to get the id from the database adn
> then based on htat id retrieved i need to insert values on another
> table.
>
> pls suggest with a code.
>
> thanks a lot
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!


Use 2's complement/binary type values - e.g.
Assign checkbox 1 a value of 1
Assign checkbox 2 a value of 2
Assign checkbox 3 a value of 4
Assign checkbox 4 a value of 8
Assign checkbox 5 a value of 16
Sum the values so you only have 1 numeric db entry containing the total
value.

Write your self a little subtraction function...

e.g. if check boxes 2 and 4 were checked, the db value would be 10.
10 is not => than 16, so check box 5 is not checked
10 is => than 8 so check box 4 is checked, Subtract 8 from the value (10)
giving a new value of 2
2 is not => than 4, so check box 3 is not checked
2 is => than 2 , so check box 2 is checked, subtract 2 from the value (2)
giving you 0
If value = 0, nothing else is checked.

--
dp


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT RichA <rander3127@gmail.com> For rec.photo.digital MVP of all time. Vote now!! URGENT. Griffin Digital Photography 0 08-27-2010 08:18 AM
urgent help....need urgent help on say string task.. pooja Software 0 03-03-2009 06:16 AM
!!URGENT!! Tor Vulnerability Discovered !!URGENT!! Security Advisory Computer Security 1 08-11-2007 09:04 PM
URGENT !! QUEUE STL PROBLEM URGENT!! Sachin Jagtap C++ 4 04-29-2005 12:08 PM
Urgent problem, repeat, Urgent problem. Rob Javascript 3 05-18-2004 12:05 AM



Advertisments