Home › Forums › Front-end Issues › Trigger verification of the form without submitting it › Reply To: Trigger verification of the form without submitting it
I’ve used the checkValidity()
JS function.
$('#form-part-1 button.input-submit').click(function(e) {
e.preventDefault();
var valid = true;
$('#form-part-1').find('input').each(function() {
if (valid === true) {
valid = this.checkValidity();
}
});
if (valid === true) {
$('.acf-error-message').remove();
$('#form-part-2').show();
$('#form-part-1').slideUp();
}
});
This isn’t perfect, and it don’t use acf/validate_value
or acf/validate_save_post
, but I can’t manage to use them with the ACF Javascript API
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.