Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7088 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

On one of our site there is an a field that we apply a value list to in the form of checkboxes. In this case there is only one value in the value list. so either they can check it or uncheck it. The problem is if they do not check anything and the box is previously checked the database will not update the field with nothing. In other words if there was something in the field (so the box is currently checked) and they uncheck the box (so now there are no boxes checked at all) and submit the form, the database will not erase what is in the field and make it blank.

Any thoughts on why this is?

Thanks,

Nick

  • 2 weeks later...
Posted

This was always a known problem with "empty" checkboxes (or unchecking them).

Try adding a hidden input for the same field with the value of empty:

' <input type="hidden" name="yourFieldName" value="" />

' <input type="checkbox" name="yourFieldName" value="1" />

NOTE, I didn't account for checked="checked" (as in previously selected).

This topic is 7088 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.