0

Looking at the FormValidation getting started docs, they use a row: '.col-xs-5' property in the script of their Complex Form example. I'm trying to wrap my head around why this is necessary? Does it have something to do with properly displaying the feedback message?

4

1 回答 1

1

他们使用 row 选项根据输入的大小为错误消息指定大小。

例如 :

<div class="col-xs-8">
      <label class="control-label">Movie title</label>
      <input type="text" class="form-control" name="title" />
</div>

标题输入的大小是col-xs-8,您还必须提供一个带有col-xs-8验证选项的行选项,以正确宽度显示错误消息,即输入(col-xs-8)的大小。

 title: {
                row: '.col-xs-8',
                validators: {
                    notEmpty: {
                        message: 'The title is required'
                    },
                    stringLength: {
                        max: 200,
                        message: 'The title must be less than 200 characters long'
                    }
                }
            }
于 2015-03-10T14:21:32.963 回答