RequiredFieldValidator與Attributes.Add沖突
發布時間:2009/8/5 15:52:28 作者: 閱讀:909
廣告:
this.Add.Attributes.Add("onclick", "return checkform(document.getElementById(\"eachpage3\").options[document.getElementById(\"eachpage3\").selectedIndex].value);");
前臺:
function checkform(selvalue)
{
if (typeof(Page_ClientValidate) == 'function') {
if (Page_ClientValidate())
{
if(selvalue=="" || selvalue==null) {
alert("對不起,請選擇版面!");
return false;
}
}
}
return true;
}
<asp:Button ID="Add" runat="server" Text="添加" Width="58px" CausesValidation="false" OnClick="Add_Click"></asp:Button>
Add加入: CausesValidation="false"
廣告:
相關文章