checked AND unchecked

J

Joel Brabant

Hi again,

Within a submitted page that has mutilple checkboxes with
the same name, the request.form("mycheckboxes") has a
comma separated list of the values of all the ones
checked....
but I also need to know which ones are not checked... How
can I know that ?

Thanks.
 
T

Tom B

It's the rest of them ;)

You need to either go get them again, or include all the values in a hidden
field.

I'm assuming your checkboxes are coming from a database. So you could
requery the database and compare the returned values with those submitted.

OR

On your form, you can put in a hidden field with all the values in it.
<input type=hidden name=AllPossibleCheckboxValues value="1, 2, 3, 4, 88">
 
R

Ray at

They will not be returned in the form collection if they are not checked.
How are the checkboxes being created? Can you not pull from the same source
to get that information?

You could use a hidden input on your form and then compare the values:

<inpt type="checkbox" name="chk1" value="1">
<inpt type="checkbox" name="chk1" value="2">
<inpt type="checkbox" name="chk1" value="3">
<inpt type="checkbox" name="chk1" value="4">
<input type="hidden" name="allPossibleValues" value="1,2,3,4">

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top