Mark Steggles
asked on
jquery custom credit card validation
Hello,
I'm using jquery validate script and was using creditcard method. Now my client has obfuscated the credit card number if someone goes to edit their credit card info. Obfuscated with *****'s
So, I need a custom validation for jquery validate script to check for
credit card number or ***********'s + last 4 digits
Any ideas?
Thanks
I'm using jquery validate script and was using creditcard method. Now my client has obfuscated the credit card number if someone goes to edit their credit card info. Obfuscated with *****'s
So, I need a custom validation for jquery validate script to check for
credit card number or ***********'s + last 4 digits
Any ideas?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use the this extra functionality for the full credit card number
http://www.ihwy.com/Labs/jquery-validate-credit-card-extension.aspx
http://www.ihwy.com/Labs/jquery-validate-credit-card-extension.aspx
ASKER
Thankyou Gurvinder32,
This [\*]+[0-9]{4} works on ***********4123
but it also needs to work for digits only 123123123123123123
what would be the update to make it work for that aswell?
Thanks
This [\*]+[0-9]{4} works on ***********4123
but it also needs to work for digits only 123123123123123123
what would be the update to make it work for that aswell?
Thanks
ASKER
solution was not complete
This should allow either:
var re = /^(\*+|\d+)\d{4}$/;
var re = /^(\*+|\d+)\d{4}$/;
ASKER
Thank you Kravimir, I will give that a whirl
$('#creditCardNumber').val
'regularExpressions': [
{ expression: /^[\*]+[0-9]{4}$/, errormessage: 'Credit card number is not valid'}
]
});
download this package from here
http://www.unwrongest.com/projects/valid8/#