Menu
var card_number = eval(“document.checktest.card_number.value”);
var filter = /^[0-9]{2,4})+$/;
if (!filter.test(card_number))
{
alert(‘Your credit card number can only contain numbers and have no spaces.’);
return err(f.card_number.name);
}
Above is my code. I’m trying to check the user’s credit card number to make sure of two things. NO spaces, and all numbers and numbers only. I thought this was the right checker to develop, but it’s not working. Ignore the return err(f. etc. etc. because that is the name of the error checking function which I know works. If anyone can help I’d really appreciate it. Thanks!