I'm trying to disable a submit button to check if all the input fields are filled before submitting. I've checked and used most of the codes here. I have found a handful that works, but the problem is the code works when I check it on a console window, but it doesn't work when I include it on a WordPress site. I'm using Skyboot Custom Script Panel and i have put the script after the footer.
Here is the code:
var $ = jQuery.noConflict();
$(document).ready(function() {
$('button').attr('disabled', true);
$('input').on('keyup blur', function() {
if ($('[data-wof-field~="primary_email"]').val() != '' && $('[data-wof-field~="text_2"]').val() != '' && $('[data-wof-field~="number_1"]').val() != '' && $('[data-wof-field~="text_1"]').val() != '') {
$('button').attr('disabled', false);
} else {
$('button').attr('disabled', true);
}
});
});
Thanks in advance,