I recently upgraded to Forms 10.2.1 and had the code below working in 10.1 but after the upgrade I get an error when submitting. I've diagnosed it to be a problem with the javascript because when I take it out, the form submits as expected (but the stored procedure does not run). Please help!
Code that was working in 10.1
$(document).ready(function(){ //Change Title of Tab $('title').text('INTERNAL CLAIM FORM') //End Title //Required fields red $('.cf-required').parent().css('color', 'red'); //End required fields red $('#q3 input').attr('readonly', 'true');//this is the claim number field I'm looking to fill with the stored procedure $('.action-btn').on('click', function(event) //On submit event make sure that all required fields are satisfied { var hasEmptyRequiredFields = $.grep($('.required'), function(value, i) { return $(value).val() === ''; }); if ($('.notused').val() === 0 && hasEmptyRequiredFields.length === 0)//Notused is a hidden field that defaults to 0, then changes to 1, triggering my stored procedure { event.preventDefault(); $('.notused input').val("1").trigger('change');//This is the stored proc trigger var interval = setInterval(function(){ if($('#q3 input').val() !== '') { clearInterval(interval); $("#form1").submit(); } }, 500); } }); });
Thanks,
Nate