【问题标题】:Bootstrap input tags apply required validation引导输入标签应用所需的验证
【发布时间】:2020-04-06 23:42:53
【问题描述】:

我正在使用引导标签输入https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/ 并成功实施。我只想将其设为必填字段,以便每个用户提交带有技术标签的表单。

<div class="col-lg-6">
 <label class="">Primary Skills (Note: Add comma separated) <span class="text-danger">*</span></label>
 <input class="form-control" type="text" id="primaryskill" name="seeker_primary_skills" required>
 <b class="tooltip tooltip-top-right">This is a required</b>
</div>

这是这个的截图。

【问题讨论】:

    标签: php jquery codeigniter twitter-bootstrap-3 bootstrapvalidator


    【解决方案1】:

    检查表单提交的返回

    <form onsubmit="return checktag()">
    

    Javascript/Jquery 代码

    function checktag(){
       if($("#primaryskill").val() == ''){
          alert("Tags Required"); //Here you can simple alert or change input css with 
          border red with msg with the help of jquery
          return false;
       }else{
            return true; 
       }
    }
    

    【讨论】:

    • 已应用引导验证程序,因此不要使用这种类型的事件。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-10
    • 2021-09-20
    • 2016-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多