It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Form Validation

Form Validation

Postby hbradshaw on Sat Jun 13, 2009 10:54 am

Hello:

I could use some help. I have a form where I'm having people enter URL's into textboxes that should not contain URL's.

How can I write a form validation script where I can check that each textbox field does NOT have a URL in it?

For example, the phone number textbox field should only accept a valid phone number (###) ###-####. The name textbox field should only contain letters (no numbers or characters).

Can someone help me write something?

Thank you.
hbradshaw
 
Posts: 1
Joined: Sat Jun 13, 2009 10:50 am

Re: Form Validation

Postby rangana on Mon Jun 22, 2009 6:58 am

You need to learn RegularExpression to make thins easier for you.

You might find these links a good way to start :
http://www.devarticles.com/c/a/JavaScri ... ns-Part-1/
http://www.javascript-coder.com/html-fo ... tion.phtml
http://www.javascriptkit.com/javatutors/re.shtml

Hope that helps you write somethuing for yourself.

If you're stumped, get back and we're more than willing to offer a hand :)
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines


Who is online

Users browsing this forum: No registered users and 4 guests