How to validate form using JavaScript

Share

Here now you will learn how you can validate a form using a JavaScript, its client side validation and better than the server side validation because the server side validation is some how time consuming.

First you should have a form to check for example here we have

[code lang=”html”]

Name:

E-mail Address:


Telephone:
Please do not call me.

What can we help you with?

Comments:

[/code]

then you may now check either user puts a valid data or not by using the script,

[code lang=”js”]

[/code]

so now you will be able to validate your form at client side as its easy to learn and handle.

the function in the script can call in the onsubmit even of the form and the action converted to the # sign.

I found this is easy so i share it with you to learn from it.

Hope you learn from it

© 2018 IT Tech Developer | XML Sitemap | HTML Sitemap
Powered by T-Developers | Designed by: Shah Rukh | Thanks to Friends
show
 
close
rss Follow on Twitter facebook linkedin youtube google+ email