Hi Dinesh, Is there a way to add a specific class to the GravityForms form when it has succesfully validated all the necessary fields? The reason behind this is that I would like to color the gform submit button green when all (required) fields are filled in correctly.
At first I thought I’ve fixed this by using the jQuery valid() method like this:
jQuery(function ($) {
$(window).on(‘load’, _ => {
$(‘.gform_wrapper form’).each((_, formElement) => {
let $form = $(formElement)
$form.on(‘change keyup’, e => {
$form.toggleClass(‘is-valid’, !!$form.valid())
})
})
})
})
The only problem is that when the first required field is filled in all the other required fields in the same form are getting marked as invalid. Any tips or tricks to help me out? Thank you in advance!