Javascript function not executing because input field is hidden?
Hi,
I'm trying to use this credit card validation library (
http://jquerycreditcardvalidator.com/ ) and the primary method you call
must have this structure:
$('#card_number').validateCreditCard(function(result) {
});
My form is a javascript multi-step wizard so the "card_number ( <input id="card_number" />) field isn't shown on step 1, it gets shown once the user reaches step 4 so when the page loads the above code doesn't really do anything because the "card_number" field isn't in the DOM
I believe. I'm wondering how can I attach the above snippet so when the credit card number field is visible the function will work as expected. If I move the field to step 1 in my wizard the code works, but not on step 4 because the field is hidden.
Any help appreciated.