This module would be a great addition to webform! :) Take the work out of building your own!
Not sure if this is ok to do here but would like to request validation for:
Minimum number of selections required
Maximum number of selections allowed
Exact number of selections out of whatever listed
Thanks!
Comments
Comment #1
svendecabooterThese validation rules have been added in HEAD.
A new release of this module will follow shortly.
Comment #3
visitor82 commentedHi svendecabooter
Great module, thank you for the effort. I have a need for the exact same feature as above but it isn't working for me. I am running webform 6.x-3.4 and webform validation 6.x-1.3.
My use case might be an issue.
1. I am building a social sports tipping site.
2. On a page I have a web form with 30 textfields for the "who will win the event" questions.
3. I have used 30 "select option" fields to create a radio button next to each question where a player can elect to play a set number of "jokers" and double the points awarded.
4. I have used Arrange Fields/JQuery UI to position the radio buttons next to the textfield questions
I want webform validation to only allow say 5 of the 30 picks to have jokers. As per the post above I have tried every combination of rules without success. I have tested it in other ways and webform validation is working I just can't make it work in this situation.
All I can think of is that its something to do with my use of select options. Because I want only 1 radio button that is on for selected or blank for not selected it is set up with multiple values ticked in the "edit field" options. If I don't tick this box once a user selects the radio button they can't deselect it.
I hope you have an idea where my problem lies.
Thanks, Warwick
Comment #4
visitor82 commentedComment #5
svendecabooterComment #6
svendecabooterHi WazzaD,
Sorry for the late reply. What you are trying to accomplish is not possible with your current setup.
If you create a rule "Exact number of selections required" with the number set to 5, this will check for 5 selections on EACH of the components you have added that rule to. The main use case would be a multiselect list or list of checkboxes with e.g. 30 options, where you should select 5.
So in fact you would need one "select" component with 30 options, and add the rule to that one component. Of course visually those would become checkboxes then, and they wouldn't be positioned next to the textfield they belong to. I guess that last issue could perhaps be fixed with some clever CSS and JS. But they will still remain checkboxes instead of radiobuttons though (unless you're also able to do some JS wizardry to have them appear to be radiobuttons).
Hope that helps...