You use the ignore-option (a selector) to set additional elements to
ignore when validating. One approach would be to define a class in
your stylesheet with display:none, then adding and removing that class
to hide an element, and set the option ignore:
".customClassHidingElements".

Jörn

On Fri, Oct 10, 2008 at 12:23 PM, Weyert de Boer <[EMAIL PROTECTED]> wrote:
>
> Hello!
>
> I am currently hiding or showing specific form fields depending on
> specific conditions. Only if the field is hidden they are still used
> to validate against when submitting the form. Are there any ways to
> ignore any field validations when the element is hidden? Because when
> the field is hidden it doesn't have to be filled in.
>
> Any way to solve this? I am currently using code like this:
>
> $("#question_2").click(function() {
>   var itemValue = $("#question_2").val();
>   var toggleItems =
> $("#field-question_11,#field-question_12,#field-question_13");
>   var condition = eval("itemValue == 'd'");
>   if ( condition ) { toggleItems.show() } else { toggleItems.hide() };
> });
>
> Yours,
> Weyert de Boer
>

Reply via email to