如何验证所有文本框?

时间:2016-01-18 07:02:32

标签: javascript jquery jquery-validate

这是填写在线测试的空白。所以我需要填写所有文本框。

Demo

<form action="" method="post" id="question_form" class="cmxform" enctype="multipart/form-data"> 
      <input type="text" class="form-control fillblank boxes" placeholder="Type Here" name="24" id="4"  required="true" >
      <input type="text" class="form-control fillblank boxes" placeholder="Type Here" name="24" id="5"  required="true" >
      <input type="text" class="form-control fillblank boxes" placeholder="Type Here" name="24" id="6"   required="true" >

1 个答案:

答案 0 :(得分:0)

name必须具有唯一值,使用name作为数组,试试这个

<form action="" method="post" id="question_form" class="cmxform" enctype="multipart/form-data"> 
  <input type="text" class="form-control fillblank boxes" placeholder="Type Here" name="24[0]" id="4"  required="true" >
  <input type="text" class="form-control fillblank boxes" placeholder="Type Here" name="24[1]" id="5"  required="true" >
  <input type="text" class="form-control fillblank boxes" placeholder="Type Here" name="24[2]" id="6"   required="true" >