close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to send 0 value for non selected checkbox

Thread began 6/13/2013 5:47 am by info4753 | Last modified 6/17/2013 5:57 am by info4753 | 1164 views | 5 replies |

info4753

How to send 0 value for non selected checkbox

If I select my checkbox in my form the value 1 is being saved into the database. If the checkbox is not selected the value NULL is submitted. How do I send the value 0 to the database when the checkbox has not been submitted?

Thanks for any help

Sign in to reply to this post

Jason ByrnesWebAssist

in the insert and update record behavior, selct the column that the checkbox is bound to and set the data type to "Checkbox 1,0"

Sign in to reply to this post

info4753

Thx Jason, missed that ... ;-)

Sign in to reply to this post

info4753

It doesn't seem to work. I have 2 form pages one with the form fields, one with an overview and hidden fields that contains the insert behaviour. It looks like that the checkbox from the first form field is not submitting a 0 value if the checkbox has not been selected:

<input type="checkbox" name="Catering" id="Catering" value="1" class="formCheckboxField_Standard" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("resformular2","Catering"):""),"1"))) {echo "checked=\"checked\"";} ?> tabindex="10">

Therefore I do always get a 1 into the database. Any ideas what might go wrong here?

Sign in to reply to this post

info4753

This post has been deleted.

info4753

Got the solution, added "0" to:

<input name="HCatering" type="hidden" value="<?php echo((isset($_POST["Catering"]))?$_POST["Catering"]:"0") ?>">

and on the insert behaviour went back to "integer"

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...