Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 同一页面上的boostrap验证程序具有多个表单_Twitter Bootstrap_Validation_Bootstrapvalidator - Fatal编程技术网

Twitter bootstrap 同一页面上的boostrap验证程序具有多个表单

Twitter bootstrap 同一页面上的boostrap验证程序具有多个表单,twitter-bootstrap,validation,bootstrapvalidator,Twitter Bootstrap,Validation,Bootstrapvalidator,我有一个页面,有两个表单“注册”类“sup”和“登录”类“si”, 我使用这些类创建boostrap模式: $(".si").click(function (e) { e.preventDefault(); $(".si_section").show(); $(".sup").hide(); $(".modal-header h4 span").html("@Resources.SignIn"); }); 他们有一

我有一个页面,有两个表单“注册”类“sup”和“登录”类“si”, 我使用这些类创建boostrap模式:

    $(".si").click(function (e) {
        e.preventDefault();
        $(".si_section").show();
        $(".sup").hide();
        $(".modal-header h4 span").html("@Resources.SignIn");
    });
他们有一些共同的领域。用户名、密码

因此,我加载scipt来为每个scipt调用bootstrapvalidator:

    $('#form-login').bootstrapValidator({
        framework: 'bootstrap',
        feedbackIcons: {
            //valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            use_email: {
                validators: {
                    notEmpty: {
                        message: '@Resources.required'
                    },
                    emailAddress: {
                        message: '@Resources.loginfailuremessage'
                    }
                }
            },
            use_password: {
                validators: {
                    notEmpty: {
                        message: '@Resources.required'
                    }
                }
            }
        }
    });

    // Form validator for registration
    $('form-registration').bootstrapValidator({
        framework: 'bootstrap',
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            use_email: {
                validators: {
                    notEmpty: {
                        message: '@Resources.required'
                    },
                    emailAddress: {
                        message: '@Resources.loginfailuremessage'
                    }
                }
            },
            Password: {
                validators: {
                    notEmpty: {
                        message: '@Resources.required'
                    },
                    emailAddress: {
                        message: '@Resources.loginfailuremessage'
                    }
                }
            }
        }
    })

但它不起作用,只有第一个是验证,我错了什么?我怎么做?谢谢

我最终做了内联编辑器,因为在我的案例中,多表单有效性有一个问题