Hello,
I am very new to javascript & jquery. I am trying compare two currency fields in my form (.invoice & .total) and if they match I want to add a value to a third field (.flag) -"Match". If they do not match I want to add the value "Does Not Match" and change the color of that third field to red as well as hide all buttons so the form cannot be submitted, approved or rejected. I'm really hoping one of you can see the error in my code :) Thank you in advance!
Terri
$(document).ready(function(){ $('.invoice','.total').change(function(){ if ($('.invoice input').val()!==$('.total input').val()){ $('.flag').css('background-color': 'red'); $('.flag input').val("Does Not Match"); $(".action-btn.Approve").hide(); $(".action-btn.Reject").hide(); $(".action-btn.Submit").hide(); } else{ $('.flag input').val("Match"); } )}; });