简体   繁体   English

formvalidation jQuery表单组

[英]formvalidation jquery form group

I am using formvalidation plugin: I have a form-group, inside of it 2 input fields, 1 is being validated one is not. 我正在使用formvalidation插件:我有一个form-group,在它里面有2个输入字段,其中1个正在被验证,一个没有。 Yet when I click validate a red border is applied to everything in the form-group even though it should not be validated. 但是,当我单击“验证”时,即使该窗体组中的所有框都不应该通过验证,它也会应用一个红色边框。

Any ideas why? 有什么想法吗?

   <div class="form-group">
    <div class="row">
        <div class="col-xs-4">
           <input type="text" class="form-control" name="phoneNumber" placeholder="Phone" />
        </div>

        <div class="col-xs-4">
           <input type="text" class="form-control" name="rooms" placeholder="# of bedrooms" />
        </div>
    </div>
</div>

http://jsfiddle.net/k281at67/48/ http://jsfiddle.net/k281at67/48/

UPDATE 更新

Add this to each object and it works like you wish. 将此添加到每个对象,它就像您希望的那样工作。

row: '.col-xs-4',

As in

phoneNumber: {
  row: '.col-xs-4', // adding this to each object fixes issue.
  validators: {
    country: 'United States',
    ...

jsFiddle Link jsFiddle链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM