Conditional Validation
How can I validate a form field only if a particular item in a menu/list is selected? I am using Validation Toolkit 2 and css form builder.
Cheers
Dave
How can I validate a form field only if a particular item in a menu/list is selected? I am using Validation Toolkit 2 and css form builder.
Cheers
Dave
I think you could do this with a server side validation, but you will need to customize the trigger for it.
You would want to add in a server side validation from the server behaviors menu, for the trigger you should choose the select list you want to check the value of to see if you need to validate the other field.
Next you would choose the validation type and form field to conditionally validate based on this.
Once you have configured it you will need to customize the trigger for it, rather than just checking the isset for the posted element you will also need to check to see if it's value is equal to the value you are looking for. If it is then the validation will run against the field, otherwise no validation will occur for that form field.
This is a somewhat custom implementation of the server side validations for this situation. There are other more custom ways you can do this if you need to also incorporate other server validations on the page. Let me know if you have any further questions on this.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.