Click to See Complete Forum and Search --> : button validation and link


Edward Files
07-21-2003, 09:48 PM
I'm looking to validate data input and if the input is correct than I want the submit button to take the user to a desinated website.

pyro
07-21-2003, 09:51 PM
We're going to need to know what qualifies as "valid" data to help you out much, other than telling you that you will need regexp (http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/regexp.html#1193136)...

Edward Files
07-22-2003, 12:08 AM
All I would like to be able to do is when a user inputs their name that it's all letters and not numeric and that entrys that are suppose to be numeric are. When the user clicks on the submit button if the information is not what it should; text or numeric; than a message will inform them, other wise it will take them to a desinated site.

pyro
07-22-2003, 07:00 AM
To check for alphabetic characters:

/[a-zA-Z]/.test(document.formname.fieldname.value)

To check for numeric characters:

/\d/.test(document.formname.fieldname.value)