[Javascript] excluding special characters in a form

Rinnert, Ring ring.rinnert at e-formationinc.com
Tue Mar 12 17:32:07 CST 2002


Hi all...thanks for the help in advance. I have a bit of code in which I
want to send an alert message telling the user that he cannot put any
special characters in his name while filling out a credit card form online.
Here's the code: 
 
if (document.customerForm.lastname.value == "") { 
            msg = "You must enter your name without any special characters";

            document.customerForm.lastname.focus(); 
} 
if (document.customerForm.firstname.value == "") { 
            msg = "You must enter your name without any special characters";

            document.customerForm.firstname.focus(); 
} 
 
Currently the code only gives the alert message when a user leaves the field
blank. How do I only accept the English Alphabet? 
Thank you so much for your help! 
 
 
 
 
 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20020312/b98d8261/attachment.htm>


More information about the Javascript mailing list