close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Bind checkbox and radio groups

Thread began 4/18/2011 4:07 pm by gdavis421484 | Last modified 4/21/2011 2:37 am by gdavis421484 | 2634 views | 6 replies |

gdavis421484

Bind checkbox and radio groups

Are there examples anywhere on how to bind a checkbox and a radio group to enable them to retain their values until a sucessful form submission?
i.e. if validation fails on form submission e.g. on an incorrect captcha being entered, I want the checkbox to retain it's value and a radio group to retain it's value.

Sign in to reply to this post

Jason ByrnesWebAssist

is it a single checkbox? or a checkbox group? a check box group will require some hand coding. For a single checkbox though, select it, then click the dynamic button in the property inspector. Click the lightning bolt next to Check If and select the checkbox item from the Validated Entries collection. Set the Equal To option to the same as the checked value for the check box.

Radio button groups are very similar.

Sign in to reply to this post

gdavis421484

Thanks Jason,
It is a single checkbox and I have done as you said but the check box always reverts to the default value of "checked".
The radio buttons I have not attempted yet.

I can only get it to remember the checkbox state by having the "Initial State" set to 'unchecked'

If I set the Initial State to 'checked' - which is what I want - the checkbox always returns to 'checked' when I click submit (even if it was unchecked before I clicked submit)

Sign in to reply to this post

Jason ByrnesWebAssist

please send a copy of the page in a zip archive so I can examine the code.

Sign in to reply to this post

gdavis421484

zip file of page attached

Please find zip file attached.

Attached Files
SendInName_V3.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the checkbox code should be:

php:
<input <?php if (!(strcmp((ValidatedField("SendInNameV3_156","OK to join miling list"))) {echo "checked=\"checked\"";} ?>   name="join_mail_list" type="checkbox" id="join_mail_list" value="OK to join miling list" />




you have a hard coded " checked="checked"" at the end that is overriding the dynamic setting.

Sign in to reply to this post

gdavis421484

Thanks Jason,
I will point out that the hard coded checked="checked" was put there by Dreamweaver (not me) to set the check box as "checked" when the page first opens - so other people might want to look for this if they have a similar problem.

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...