The Form validation rules are enforced even when the fields are hidden by the Conditional Rules.
Desired function: If the fields are hidden, they should not be checked.

Example:
If the user chooses an option 1 in a "Select Options" field, an additional "Textfield" field is displayed (via Conditional Rules) to enter a PromoCode. When submitted, the PromoCode field is checked for an allowable code (via the Form Validation rules). OK.
Screen Cap

When the user chooses option 2, no additional "Textfield" field is displayed. OK.
But when submitted, the Form validation rule is still run; and throws an error because no code is entered.
The rule should not run, because the field is NOT displayed.
Screen Cap

Comments

quicksketch’s picture

Project: Webform » Webform Conditional (Same Page Conditionals)
Version: 6.x-3.18 » 6.x-1.1

Same-page conditionals are not provided by Webform core. You're probably describing behavior of http://drupal.org/project/webform_conditional, which enables same-age functionality. Moving this issue over there.

jessSchn’s picture

I am experiencing this same issue. Do we have any progress on a fix?

Although, I've noticed that if I have a conditional setup (select a radio button) and then when a radio button is selected and then I have another conditional (select a dropdown option - required). It seems that my form will only throw an error on the required nested conditional. All other required fields do not display an error. - If that makes any sense?

tedbow’s picture

Status: Active » Postponed (maintainer needs more info)

When submitted, the PromoCode field is checked for an allowable code (via the Form Validation rules). OK.

Is "Form Validation rules" another module? If so please provide a direct link.

Thanks

john franklin’s picture

I'm seeing a similar issue also with 6.x. I don't believe I'm using a "Form Validation" module, just the normal "required fields" stuff. I'll see if I can create a sample form and node export it.

john franklin’s picture

Here is a webform that demonstrates the failure. It works fine for textfield and select form components, but Grid components are required, even if hidden.

john franklin’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.68 KB

So, I could just special case the 'webform_grid' components and disable all the sub-FAPI elements, but why not take it to the next level and turn it into a hook so other webform modules can disable their own subfields, no matter how complicated they are?

This patch adds HOOK_webform_conditional_set_required(&$element, $value) and implements it for the set of base webform components. Other modules should implement it if they have complex subform that needs special attention when webform_conditional is tweaking the form in response to hiding or showing components.

jessSchn’s picture

So, here is a newb question:

How do I apply the patch to the module?