Steps to reproduce
1. Install Webform 4.19 (careful!!! - this one has a known security issue, so do not do this on a production site)
2. Create a new webform.
3. Add a new component of type "Select options", called "Was this page useful?", and set it to required.
4. As options for the element created in step 3, add 1|Yes and 2|No, and save.
5. Create another component of type "Select options", called "Why yes?", and set it to be both multiple and required.
6. As options for the element created in step 5, add easy|Was easy, makes_sense|Makes sense, and other|Other, and save.
7. Create yet another component of type "Select options", called "Why no?", and also set it to both multiple and required.
8. As options for the element created in step 7, add because|Because, confusing|Was confusing, and dont_wanna_say|Don't want to say, and save.
9. Add the following conditionals:
9.1. if Was this page useful? | is empty | or
if Was this page useful? | is | No
then Why yes? | isn't | shown
then Why yes? | isn't | required
9.2 if Was this page useful? | is empty | or
if Was this page useful? | is | Yes
then Why no? | isn't | shown
then Why no? | isn't | required
10. Test the webform:
10.1. Select either "Yes", or "No"
10.2. Try submitting the form without selecting any of the options for "Why yes/no" -> validation error shown (as expected), in the form of a drupal_set_message error
10.3. Select only one of the options in the checkboxes that are shown
10.4. Submit the form -> form is submitted w/o any errors (as expected)
11. Update the Webform module to version 4.20 (no database updates required).
12. Test the form again:
10.1. Select either "Yes", or "No"
10.2. Try submitting the form -> validation error shown (as expected), notice that the error is now shown as a popup
10.3. Select only one of the options in the checkboxes that are shown
10.4. Submit the form -> form is not submitted (regression) -> another popup validation error is shown, saying that the next option in the checkboxes is required.
10.5. Keep repeating steps 10.3 and 10.4, selecting the next checkbox and trying to submit the form -> the form is only submitted when all checkboxes have been selected
Original report
Hi,
I have a webform with a multiple choice select field. The field is marked as required.
When I try to complete the form and check one of the options, I get an error message which says that the last check box is required. When I try to validate the form by checking the last check box, i get an error message that says the second last check box is required, and so on... till all check boxes are checked.
It's like the webform module treats the check boxes as separate fields.
I had also the "Webform validation" module installed, but even when I deactivate the module, I got the same problem.
Comments
Comment #1
manicato commented... this happens even if I uncheck the "required" option!
Comment #2
quicksketchHm, this sounds quite unusual. Do you have the Select or Other module installed on your site? Or is there anything special about your checkboxes?
Comment #3
manicato commentedI'm sorry. I choose the wrong Drupal Version it's 6.x-3.x-dev.
It found the problem.
In fact, there was a module which causes this error: Client Side Validation module
It's not essential, so I removed it.
Comment #4
klonosI am seeing this on a site that does not have the Client Side Validation module.
I will need some time to test this in a vanilla installation, and on a webform with just enough fields to reproduce the problem. I'll report back soon.
Comment #5
klonosComment #6
klonosI have updated the issue summary. ...this seems to have regressed from 4.19 to 4.20, with the introduction of the popup validation errors.
Comment #7
klonosComment #8
liam morlandPlease use
git bisectto determine which commit caused this problem.Comment #9
klonosSure thing @liam-morland. Here it is:
...so it seems to have been introduced with #3032336: Conditional required does not work for single checkbox
Comment #10
liam morlandDrupal 7 is no longer supported. If this applies to a supported version, please re-open.