You can validate your HTML form simply applying this static class…
example:
<form
onsubmit="
return
Validate.form(this,
{notEmpty:
['userEmail','reEmail', 'userPassword','rePassword'],
equalTo:
['userPassword,rePassword','userEmail,reEmail'],
update:
'top-message'})
">...<form>
Here is validation code…
var Validate={
// set notEmpty as parameter to perform not empty validation
// set equalTo as parameter to compare 2 fileds validation...
// you have to setup update parameter so... it will setup the error message
form: function(form, params) {
var msg="";
// validate "notEmpty"
for(var i=0; i < params .notEmpty.length; i++) {
var field=params.notEmpty[i];
if(this.isEmpty(this.getField(form, field))) {
msg +="
- "+msg+"
Thank you think it will helpful…





Recent Comments