I have tested the following validation script: jQuery validation plug-in 1.7
- How to make working validation error as I have to use action=""
Is there possibility as error is not working in this case.
Where is set id="cname" name="name" within validation script?
A simple comment form with submit validation and default messages
Name *
URL demo: http://bassistance.de/jquery-plugins/jquery-plugin-validation/
I kindly ask you to send me correct script that it will not be submitted data when user refreshes form but only after validation is validated/confirmed.Should be form named by any ID? Example: myform1
I have currently as sample:
JQuery.validator.setDefaults({
submitHandler: function(form) {
form.submit();
}
});
jQuery(function() {
jQuery(".myform1").validate({
rules: {
name: {
required: true,
},
messages: {
name: {
required: 开发者_运维问答"Requested field",
}
);
});
You can control what the form does once the validation rules have been passed. To simply have the form submit the data to the form action, use:
$.validator.setDefaults({
submitHandler: function(form) {
form.submit();
}
});
精彩评论