【问题标题】:probleme with bootstrap validator引导验证器的问题
【发布时间】:2017-06-11 16:25:42
【问题描述】:

问题是如果我用绿色填充第一个输入第二个输入高亮,如果清除第一个输入第二个输入高亮用芦苇 我用这个脚本尝试了很多解决方案,但我不明白是什么问题

<form id="contactForm" method="post" class="form-horizontal">

  <fieldset>
    <legend align="">Information Personnel</legend>
    <div class="form-group">
            <div class="col-sm-5">
                <label>Prénom</label>
                <input type="text" name="1" class="form-control" placeholder="Prénom">
            </div>
            <div class="col-sm-5">
                <label style="display:block; text-align: right;">الإسم</label>
                <input type="text" name="2" class="form-control keyboardInput"  placeholder="الإسم" style="text-align: right;">
            </div>
    </div>

      <div class="form-group">
        <div class="col-md-9 col-md-offset-3">
            <button type="submit" class="btn btn-default">Validate</button>
        </div>
    </div>
  </fieldset>
</form>

这是java脚本

$(document).ready(function() {

    $('#contactForm').bootstrapValidator({
        //container: '#messages',
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            1: {
                validators: {
                    notEmpty: {
                        message: 'Veuillez remplir votre nom'
                    }
                }
            },
            2: {
                validators: {
                    notEmpty: {
                        message: 'Veuillez remplir votre hhhh'
                    }
                }
            }
        }
    });
});

【问题讨论】:

    标签: bootstrapper jquery-form-validator


    【解决方案1】:

    将您的字段一一放入表单组中

    <div class="form-group">
                <div class="col-sm-5">
                    <label>Prénom</label>
                    <input type="text" name="1" class="form-control" placeholder="Prénom">
                </div>
    </div>
    <div class="form-group">
                <div class="col-sm-5">
                    <label style="display:block; text-align: right;">الإسم</label>
                    <input type="text" name="2" class="form-control keyboardInput"  placeholder="الإسم" style="text-align: right;">
                </div>
        </div>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多