Required fields inside hidden group
-
Hi and thanks for amazing plugin!
I have an issue with this:
>Required fields inside hidden groups will never trigger validation errors.How can I show the hidden group after let’s say clicking on the link?
I have a contact form, where user can select the reason of contact, and it shows the probable solution, and also the link ‘I still need help’. I added some simple jQuery to show the hidden group after click on this link, but all required fields inside that group became non-required (it works fine when hidden group is shown by condition, but not by mine js).
As for now, I solved it using old good jQuery, but I’m wondering if there’s better solution?my solution:
$(".still-need-help_js").click(function (e) { e.preventDefault(); $("div[data-id=\"still_need_help\"]").removeClass("group-visible"); $("div[data-id=\"contactgroup\"]").addClass("group-visible"); $('.wpcf7-form').removeAttr('novalidate'); $('.wpcf7').find('.wpcf7-validates-as-required').attr('required', 'required'); });
- The topic ‘Required fields inside hidden group’ is closed to new replies.