BUG: Validation error message not shown for dropdowns
-
Hi there,
I think I found a bug in the way validation error messages are implemented for dropdowns.
We have mandatory dropdown. When I do not select anything, the form rightfully refuses to submit, but the validation message below the dropdown remains hidden.
https://www.violine.wien/probestunde/The gemerated code looks like this:
<span class="wpcf7-form-control-wrap text-anruf"> <div class="select_container"> <select name="text-anruf" class="wpcf7-form-control wpcf7-select wpcf7-validates-as-required fill_inited wpcf7-not-valid" aria-required="true" aria-invalid="true" aria-describedby="wpcf7-f676-p73-o1-ve-text-anruf"> <option value="">Wann kann ich dich zur Terminvereinbarung anrufen? *</option> <option value="Vormittags">Vormittags</option> <option value="Nachmittags">Nachmittags</option> <option value="Abends">Abends</option> </select> </div> <span class="wpcf7-not-valid-tip" aria-hidden="true">Dies ist ein Pflichtfeld./span> </span>
The wpcf7-is-not-valid class is set, but the CSS Rule to show .wpcf7-not-valid-tip does not work.
The reason becomes clear when you look at other mandatory field types that are not properly filled. They look like this:<span class="wpcf7-form-control-wrap tel-phone"> <input type="tel" name="tel-phone" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-tel wpcf7-validates-as-required wpcf7-validates-as-tel wpcf7-not-valid" aria-required="true" aria-invalid="true" placeholder="Telefonnummer *" aria-describedby="wpcf7-f676-p73-o1-ve-tel-phone" /> <span class="wpcf7-not-valid-tip" aria-hidden="true">Dies ist ein Pflichtfeld.</span> </span>
Here the <span class=”wpcf7-not-valid-tip” directly follows the input, which is required for the CSS rule to work.
I cannot come up with a CSS rule that would work for the way the dropdown is implemented. I would need to write some Javascript code to work around it, but I think you should rather fix CF7 instead.
Any existing workaround would be appreciated, though ??
Thanks,
Christian Toller
tethis-it.atThe page I need help with: [log in to see the link]
- The topic ‘BUG: Validation error message not shown for dropdowns’ is closed to new replies.