PDA

Click to See Complete Forum and Search --> : Check box question


nmretd
Sep 27th, 2000, 10:55 AM
I have created a registration form.

I want to use a check box with my registration form. If the user checks the box I want to enter a values of yes into my database table when the user submits the form. If the check box is unchecked I want to enter no. How do I code this ?

HarryW
Sep 27th, 2000, 10:08 PM
What's the problem you're having with this? If you can code the rest of it (I'm assuming the form's contents are included in the form too) then you ought to be able to code this. Just check whether the value of the variable passed by the checkbox is True or False, and enter the corresponding value in your recordset. If it's a problem with the database you're having then just explain it.

monte96
Sep 28th, 2000, 07:05 PM
If Request.Form("CheckBox1") = "on" Then
'Do Whatever...
Else
'Do Whatever else...
End If



Make sure you give the checkbox a name and replace Checkbox1 above with that name.