我有这个表格
<form name="myForm" action="" method="post" onsubmit="return validations(this)" >
<span>
<label>Enter Your First Name</label><input id="name" name= "field[1]" type="text" class="element text" maxlength="255" size="8" value=""/>
</span>
<br /><br />
<span>
<label>Enter Your Last Name</label><input id="last" name= "field[2]" type="text" class="element text" maxlength="255" size="8" value=""/>
</span>
<br />
<br />
<span>
<input id="field[3]" name="field[3]" class="element radio" type="radio" value="1" />
<.label class="choice" for="field[3]">Male</label>
<input id="field[4]" name="field[4]" class="element radio" type="radio" value="2" />
<label class="choice" for="field[4]">Female</label>
</span>
<br /><br />
<label class="description" for="field[5]">Enter your city </label><input id="field[5]" name="element_3" type="text" class="element text medium" type="text" maxlength="255" value=""/>
<br /><br />
<span>
<input id="field[5]" name="field[5]" class="element checkbox" type="checkbox" value="1" />
<.label class="choice" for="field[5]">I am unemployed.</label>
<br /><br />
</span>
<input type="hidden" name="form_id" value="form1" />
</div>
.
<.input type="submit" value="Validate" >
</form>
我想在单击“验证”时验证表单。检查是否所有字段 type=text 都已完成。如何动态执行此操作?