I have a form with two main conditions off a select field: Condition 1, Condition 2.
I created questions for each condition such that:
Condition 1: Question 1; Question 2
Condition 2: Question 3; Question 4*
If one of these questions is a grid and mandatory AND the non-triggering condition is selected, the question is still required. If the questions are not the type grid, the webform works as expected.
For example, if question 4 is a grid and mandatory and I choose condition 1 from the select list, upon submitting the form, I'm still required to complete question 4.
Thanks for a great module!
Comments
Comment #1
tedbowIf you could export a non-working example webform using Node Export and upload the export here that would speed up my testing.
Thanks,
Ted
Comment #2
tedbowI am going to postpone this until I get an example Webform export or at list a url to one.
Thanks
Comment #3
mfkahn commentedHere's one. Steps to reproduce: 1) import/create this form; 2) View form; 3) Click Submit -- submit will fail because of mandatory grid inside of hidden fieldset.
Comment #4
mfkahn commentedUpdate: this is probably more related to the webform clientside_validation addon module, though there is likely still a problem in this module too.
To workaround on the client side, use the jquery_update module and switch to jquery 1.4.4 or higher (did not test with older). Thin in clientside_validation.js, change the following around line 45:
self.validators[f] = $('#' + f).validate({
ignore: ':hidden',
errorClass: 'error',
errorContainer: '#' + errorel,
errorLabelContainer: '#' + errorel + ' ul',
wrapper: 'li'
});
The reason you need the jquery update is the :hidden selector in newer versions will match invisible elements as well as input type hidden elements, and thus not run the validator on anything that is not present on the screen.
However, the backend still returns an error on submit.
Comment #5
attiks commentedI created an issue for this in the clientside_validation, will have a look at it asap #1137490: Conditional grids problem (1084760)
Comment #6
jelle_sTesting revealed clientside validation does it "the right way", meaning hidden required fields are not validated after submission. However, the server-side validation of webform conditional does not let this pass. Is this a bug or does it work by design?