开发者

How to make validation with Jquery if there is ACTION within form?

开发者 https://www.devze.com 2023-02-04 13:59 出处:网络
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=\"\"

I have tested the following validation script: jQuery validation plug-in 1.7

  1. How to make working validation error as I have to use action=""

Is there possibility as error is not working in this case.

  1. 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();
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号