62,266
社区成员
发帖
与我相关
我的任务
分享
function check()
{
if(document.getElementById('<%=txtUserName.ClientID%>').value==''||document.getElementById('<%=txtPassword.ClientID%>').value=='')
{
alert('请输入用户名或密码!');
return false;
}
else
{
return true;
}
}
function check(name,pwd)
{
if(document.getElementById('name').value==''||document.getElementById('pwd').value=='')
{
alert('请输入用户名或密码!');
return false;
}
else
{
return true;
}
}<asp:TextBox ID="txtUserName" runat="server">
<asp:TextBox ID="txtPassword" runat="server">
<asp:Button ID="btnLogin" runat="server" Text="登录" OnClientClick="return check('<%=this.txtUserName.ClientID%>','<%=this.txtPassword.ClientID%>')"/><input name="ctl00$ContentPlaceHolder1$txtPassword" type="text" id="ctl00_ContentPlaceHolder1_txtPassword" />
document.getElementById('<%= btnLogin.ClientID%>').onclick=check();