Java Script Validation
JavaScript Validation its important the web page because user attractive the form. Webpage user click the empty input box validate JavaScript. Through alert message JavaScript provides you the facility the validate the form on the client side so processing will be fast than server-side validation. So, most of the web developers prefer JavaScript form validation
Through JavaScript, we can validate name, password, email, date, mobile number etc fields.
Simple Form Validation Bellow:
function validateform(){ | |
var name=document.online.name.value; | |
var password=document.online.password.value; | |
if (name==null || name==""){ | |
alert("Name can't be blank"); | |
return false; | |
}else if(password.length | |
alert("Password musst be 8 chracters "); | |
return false; | |
} | |
} | |
Name: | |
Password: | |
Simple Password Validation
="text/javascript"> | |
function msg(){ | |
var pass21=document.online.pass.value; | |
var pass1=document.online.pass2.value; | |
if(pass21==null || pass21=="" & pass1==null || pass1==""){ | |
alert('fill the fist fild'); | |
} | |
else if(pass21==pass1) | |
{ | |
alert("same fileds"); | |
return true; | |
} | |
else{ | |
alert("not match please try agin"); | |
} | |
} | |
="online" method="post" > | |
Password:type="password" name="pass"> | |
Re-Type Password:type="password" name="pass2"> | |
type="submit" name="valit" value="Validate" onclick="msg()"> | |
This post first appeared on WebDesign | SEO Services Full Tutorial | PHP Full Tutorial | Javascript Full Tutorial|HTML,CSS,CMS, please read the originial post: here