Reset RequiredFieldValidator 重置 验证控件
<td style="width:100px;">姓名<span class="must_star">*</span></td>
???<td>
????<asp:TextBox ID="txtNAME" runat="server" MaxLength="60"></asp:TextBox>
????<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"? ForeColor="Red"?? Display="Dynamic"
????ControlToValidate="txtNAME" ErrorMessage="請輸入姓名"></asp:RequiredFieldValidator>
????</td>
??</tr>
?
?
<input id="Reset1" type="reset" value="重置" class="button_blue" οnclick="resetForm();" />
?
?
<script type="text/javascript">
??function resetForm() {
???//alert("test if function gets fired");
???document.forms[0].reset();
???for (i = 0; i < Page_Validators.length; i++) {
????//????Page_Validators[i].style.visibility = 'hidden';
????Page_Validators[i].style.display = 'none'; //for? Display="Dynamic"
???}
???return false;
??}
</script>
?
轉載于:https://www.cnblogs.com/freeliver54/p/3816475.html
總結
以上是生活随笔為你收集整理的Reset RequiredFieldValidator 重置 验证控件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JSP、Servlet中get请求和po
- 下一篇: perl学习之:函数总结