Link to home
Start Free TrialLog in
Avatar of Malloy1446
Malloy1446

asked on

Form Checkboxes Yes / No

I have a simple update form with data being stored in an MSAccess database.
The checkboxes are recording a "Yes" when the user checks the appropriate selection.
If the user unchecks one of the checkbox that was checked, a -1 gets stored in the database.

How do I get a "NO" or delete the "Yes" when the user unchecks the box.

My code for the checkbox is

	<input type="checkbox" name="Dialog" value="Yes" <%If Dialog = "Yes" then response.write "checked" End If%>><font size="2">Dialog<br>

Open in new window

Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

The problem with checkboxes is that if they are not checked, they are not included in the submit data.  I would set the default value to '-1' and only change it if the "Dialog" value of 'Yes' is submitted.
SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial