close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How-to validation question

Thread began 1/15/2010 5:51 pm by jcav26033 | Last modified 1/19/2010 5:31 pm by Eric Mittman | 857 views | 3 replies |

jcav26033

How-to validation question

I have a "voting" form with 10 candidates, each with a "Yes" radio buttons to indicate that the candidate is chosen. There are only six positions to fill.

Is there any way, using Form Builder to validate the form, to verify that no more than 6 and at least 1 radio button is toggled to the "on" state when "Submit" is clicked?

ANY help is appreciated. Many thanks.

Sign in to reply to this post

Eric Mittman

You can do this using the client side validations included in CSS Form Builder. The idea is that you would need to apply a client side 'required' validation to the first radio option. Next you would apply a client side conditional validation specifying the first radio option as the triggering element then the second radio option as the target. You would choose if trigger is valid then do not validate the target. You will then repeat this process for each radio option you have until you get to the last one, then you would apply any other client side validations that you would need on the page and finally add in a 'show validation errors' at the end.

I have created a simple example of how this type of validation works for you in a form. Please take a look at this example and the help documentation for applying client side validations. If you have any questions about any part of it please let me know and post back with your page you are trying to apply the validations to.

Attached Files
conditional radio selection.zip
Sign in to reply to this post

jcav26033

Thanks..I'll let you know

Eric, Thanks for the pointers. I am out of town now and will try this later in the week. I am not sure how I can test that only 6 out of 10 radio buttons are "on" or how they are able to choose other than the first radio as the their first choice, but I'll look at your example. Glad to hear that I can use the built-in validation. I was starting to cobble together a Javascript check for this---and I really don't code Javascript!

Sign in to reply to this post

Eric Mittman

In the example that I posted only one is required to make it pass validation. I have experimented with a couple of different situations and it would not be so simple to ensure that you had selected no more than six of the available choices.

One way you could do this with the custom client side js would be to loop over all of the radio options and check for a value. If there is a value then add one to a counter variable. After you have looped over all of the radio options you would then check the counter to ensure that it is 6 or less. You can then present an alert to the user letting them know that more or less selections are required.

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