Required not working on 'select' element
-
I’ve got a form which needs a select element to be required. I’ve added the code below:
[select* id:ima ima menu-927 "I'm a" "vendor" "event planner" "venue" "caterer"]
Which shows this HTML output:
<select name="ima" class="wpcf7-form-control wpcf7-select wpcf7-validates-as-required" aria-required="true" aria-invalid="false"><option value="I'm a">I'm a</option><option value="vendor">vendor</option><option value="event planner">event planner</option><option value="venue">venue</option><option value="caterer">caterer</option></select>
aria-required is showing as True, so I’m thinking that means the validation is set. Yet when I submit the form with no fields filled in that one doesn’t show error message. It also allows the form to be submitted if nothing is selected.
I’ve also tried it with
include_blank
in the wpcf7 code in case it was seeing the first option as the ‘selected’ option, but no change.Any advice on how to deal with this?
- The topic ‘Required not working on 'select' element’ is closed to new replies.