Checkbox dillema please help!

Results 1 to 2 of 2

Thread: Checkbox dillema please help!

  1. #1
    Join Date
    Dec 1969

    Default Checkbox dillema please help!

    Hi I am using a loop to extract form info from a previous page. This works well until i get to check boxes.<BR><BR>If a check box is checked the loop works, however if the checkbox is left unchecked there is no value returned from the check box in the loop.<BR><BR>When I say no value I mean that a loop like the following does not even acknowledge the existence of the checkbox.<BR><BR>------------------------------------------------------<BR>For each element in request.form<BR><BR>response.write element & " " & request.form(element)<BR><BR>Next<BR>------------------------------------------------------<BR><BR>I am entering the values into a db but if they are unchecked then an update statement runs to update the status of the checkbox. However if my loop does not detect an unchecked checkbox at all there is no way I can update it.<BR><BR>Hope this has not been too confusing.<BR><BR>Dwane

  2. #2
    Join Date
    Dec 1969

    Default RE: Checkbox dillema please help!

    As far as I know, a checkbox by default will only pass in a form if it is checked.<BR><BR>What value is passed when it IS checked?<BR>Use that and put some If/Then logic around your request. <BR><BR>If Request("checkbox1") Then &#039 checks to see if checkbox1 was passed<BR> Response.Write Request("checkbox1")<BR>ElseIf Not Request("checkbox1") Then &#039 if not passed, you write your own response<BR> Response.Write YourCustomMessage<BR>End If<BR><BR>There could be a better way, but I use this method all the time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts