Trigger validation on frmAfterAddRow event

By: Adam Wolfs | Asked: 07/28/2022
ForumsCategory: How-toTrigger validation on frmAfterAddRow event
Adam Wolfs asked 2 years ago

I'm hoping someone may be able to help. I have a series of repeaters, which are being set to hidden (.hide()/.toggle()) through jQuery.
Because of this the fields are now longer validating within the hidden fields and are falling back to php validation.
I'm wondering if it's possible to manually trigger the validation one the 'add row' click, in order to alleviate this problem? This also creates a better use experience as well as validation occurs before creating the new row.
The form is setup to be non-Ajax, but javascript validation.

1 Answers
Victor Font answered 2 years ago
I suggest you look at this: Adding and removing repeater rows is an Ajax function. If you want to trigger jQuery validation when an event fires, you have to tap into the Ajax event at the document level. The article explains how to gain access to the event and use it to manage the repeater.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community