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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

conditional validation

Thread began 12/04/2009 12:59 pm by watercolor346374 | Last modified 12/10/2009 4:25 pm by Eric Mittman | 2173 views | 5 replies |

watercolor346374

conditional validation

Hi,
I have read docs for valadation tool kit and css forms. Still not getting how to do the following:
When a customer chooses New York state they are required to choose a county, which is list/menu located in the next table row. I know this is conditional, but do not know how to implement.
Thank you

Sign in to reply to this post

Eric Mittman

The part of this that makes it difficult to apply the conditional validation is that the selected value comes from a select list. Since you are trying to validate a select list you will only have two client side validations available that you can use to trigger the conditional validation response. The two that are available are required, which won't work here since all of the choices in the state select list have a value associated with them, and regular expression. This one is probably the best fit, but you will need to come up with a regular expression to match for the NY selection.

You can then use this validation as the trigger for the conditional validation on the county select list.

Sign in to reply to this post

watercolor346374

What if I had a required check box and it asked are you a new york resident? they would check yes or no. If they check yes, the drop down for the cities and counties would show up. If that were the case would that be server side conditional?

Sign in to reply to this post

Eric Mittman

That is an excellent alternative. If you had it setup like this it would still be a client side conditional validation, but you could just use the required/not blank validation on this checkbox. You would then apply the conditional validation and refer to this checkbox for the triggering element. Once you have this pair of client validations you would put in your others validations like normal.

Sign in to reply to this post

watercolor346374

Hi Eric,
I just need some clarification using the check box method of validation:
My dilemma is: I have placed the two checkboxes (no for not NY resident and Yes if NY resident in the same table row. As I was running through the validations I noticed that each checkbox came up separatly for validation. Therefore I would have validation for each and this defeats my purpose. How can I make it so that they can check either or. So if one is blank and one is checked they get no message, but if one is checked it is ok. And then if the NY is checked I follow the recipe used for tell a friend?
Thank you

Sign in to reply to this post

Eric Mittman

To get the conditional validation working like this you will need to first apply the required validation to the yes checkbox. Next you would apply the conditional validation. For the trigger you would choose the yes checkbox, for the target you would choose your county select list. You would then say if trigger is valid then validate the target element.

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