954,176 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

text validation

How to check text validations to form data entered by user?

Can any one write a code to do this in javascript?

Sam_john_2010
Newbie Poster
2 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

When do you want the validation to happen? When you click the submit button?
An easy way would be to have a button(type="button") and an onclick event:

<input type="button" value="Click" onclick="validate();" />


Then define a validate function, inside it use javascript to take the values of the fields you want to validate and if successful submit the form.

You will find good tutorials here: http://www.w3schools.com/default.asp

javaAddict
Nearly a Senior Poster
Team Colleague
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You