I have a problem while validate my login form. I add the link to the script of jquery form validation right and the link to jquery. My php script works fine, but the form wont become validated. The success function wont become executed too. What could the reason of this cautious?
$(document).ready(function () {
$('#myform').validate({ // initialize the plugin
rules: {
username: {
required: true,
minlength: 2,
maxlength: 30
},
email: {
required: true,
minlength: 2,
email: true,
maxlength: 30
},
password: {
required: true,
minlength: 3,
maxlength: 30
}
},
submitHandler: function (form) { // for demo
success: function(res){
//here you will get res as response from php page, either logged in or some error.
window.location.href = "http://localhost/soc/main.php";
}
return false; // for demo
}
});
});
0 comments:
Post a Comment