busillis Posted March 31, 2009 Share Posted March 31, 2009 if (form.cardnumber.length <16) { document.getElementById("errors").innerHTML += "<p>Invalid card number provided.</p>"; form.cardnumber.focus(); haserror=true; } This doesn't seem to be doing anything, but the other validation ones (such as checking its not empty) is. Any idea? Link to comment https://forums.phpfreaks.com/topic/151970-solved-if-for-checking-string-length-is-not-working/ Share on other sites More sharing options...
Maq Posted March 31, 2009 Share Posted March 31, 2009 if (form.cardnumber.value.length You may also want to check to make sure they only enter digits with regular expressions. Link to comment https://forums.phpfreaks.com/topic/151970-solved-if-for-checking-string-length-is-not-working/#findComment-798069 Share on other sites More sharing options...
busillis Posted March 31, 2009 Author Share Posted March 31, 2009 Wonderful, thank you sir +1 Link to comment https://forums.phpfreaks.com/topic/151970-solved-if-for-checking-string-length-is-not-working/#findComment-798072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.