0

请帮我解决这个问题。

如何对多个选择选项使用数据验证?有什么我错过的吗?

function invalidForm(){
    var form  = $(this);
    form.addClass("ani-ring");
    setTimeout(function(){
        form.removeClass("ani-ring");
    }, 1000);
}

function validateForm(){
    var preloader = Metro.activity.open({
        type: 'cycle'
    });
    $(".stud_detls").animate({
        opacity: 0
    });
}
<form name="stu" id="stu" class="mt-2 stud_detls" method="POST" action="stud.php" enctype="multipart/form-data"  data-role="validator"  data-clear-invalid="5000" data-on-error-form="invalidForm" data-on-validate-form="validateForm" accept-charset="utf-8">
<div class="cell-sm-12 cell-md-12 cell-xl-6 cell-lg-6 cell-xxl-6">
             <div class="form-group">
             <label>Subject</label>
                  <select id="subje" name="subje[]" multiple data-role="select" data-validate="required minlength=1" data-cls-option="fg-darkOrange" data-cls-selected-item="bg-orange fg-white" data-cls-selected-item-remover="bg-darkOrange fg-white">
                        <option value="" class="d-none">-Select-</option>
                          <option value="1" >-Select1-</option>
                          <option value="2" >-Select2-</option>
                          <option value="3" >-Select3-</option>
                          <option value="4" >-Select4-</option>
                           <option value="5" >-Select5-</option>
                   </select>
          </div>
</div>
<button type="submit" id="button" class="button secondary bg-hover-darkTeal"> Submit </button>
</form>
我在使用地铁 4

4

0 回答 0