posted on April 24, 2018
•
Show version history
I am attempting to change the value of the Reject button when a checkbox is checked. That part works fine:
// if send employee attest email is checked, change cancel button to 'send attest email' $('.sendAttestEmail input').on('click', function(){ if (this.checked){ $('.Reject').val('Attest').addClass('Attest'); } else{ $('.Attest').val('Reject').removeClass('Attest'); } });
I also 'hijack' it by removing the type 'submit' and change it to 'button'. I add the 'submit' back in after the click has occurred and some actions are taken:
$('.Reject').prop('type', 'button').removeClass('Submit').addClass('fakeReject');//to hijack
Upon click of .Reject, I am getting no action. Is this because the class changed after document ready?
$('.Approve, .Reject').on('click', function(){ //do stuff });
Anyone have a suggestion? This is driving me crazy.
Thanks!
0
0