Last active
June 27, 2017 21:36
-
-
Save jericrealubit/8af8d878fc55629e7804e3e9ab2e1263 to your computer and use it in GitHub Desktop.
Creditcard Validation AMEX is not accepted: This validation is in the 4th input box in the credit card input form. Will show error msg when the user input 3 numbers in the 4th input box.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var cc_4 = $("input[name='cc_4']"); | |
cc_4.blur( function() { // DEV-599 | |
if ( (cc_4.val().length) == 3 ) { | |
var no_amex = "Sorry American Express is not accepted."; | |
if ( $('#cc_number-E').length ) { | |
$('#cc_number-E span').text(no_amex); | |
} else { | |
cc_4.after('<div id="cc_number-E" class="errMsg"><span>'+no_amex+'</span></div>'); | |
} | |
$("#cc_number-D").addClass('errFld'); | |
} else { | |
$('#cc_number-E').remove(); | |
$("#cc_number-D").removeClass('errFld'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment