62,046
社区成员
发帖
与我相关
我的任务
分享
<asp:CheckBoxList ID="banshi" runat="server">
<asp:ListItem></asp:ListItem>
<asp:ListItem>aa</asp:ListItem>
<asp:ListItem>bb</asp:ListItem>
<asp:ListItem>cc</asp:ListItem>
</asp:CheckBoxList>
<br />
<label for="email">E-mail:</label> <input id="email" class="email_input" name="email" type="text" size="12" />
<asp:Button ID="Button1" class="order_bg" runat="server" Text="提交" OnClientClick="yanzheng()" onclick="Button1_Click" />
<script>
function yanzheng()
{
if (document.activeElement.id.toString().toLowerCase().indexOf("多选") > -1)
{
return true;
}
else
{
alert("NO");
return false;
}
}
</script>
var tag=false;
var chkother=document.getElementsByTagName("input");//找模版中CheckBox
for(var i=0;i<chkother.length;i++)
{
if(chkother[i].type=='checkbox')
{
if(chkother[i].id.indexOf('sel2')>-1)
{
if(chkother[i].checked==true)
{
tag=true;
}
}
}
}
function checkEmail(email)
{
var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
chkFlag = pattern.test(email);
if(chkFlag)
{
return true;
}
else
{
return false;
}
}