修改密码页面用javascript来编写脚本,可是我不知道脚本放在那里,是放在母板页中还是内容页中,还有脚本我也有错误,高手来啊
function Checkpwd()
{
var txtTitle=document.getElementById('<%=TextBox1.ClientID%>');
var txtTitle1=document.getElementById('<%=TextBox2.ClientID%>');
if(txtTitle.value==''||txtTitle1.value=='' )
{
alert("输入不能为空");
}
else if (txtTitle.length < 6 || txtTitle.length > 16)
{
alert("输入长度必须在6个字符到16字符之间");
}
}
这是脚本,高手们,我把它放在了内容页里面,判断文本框为空是可行的,但是判断要输入长度就不行了,
------解决方案--------------------
JScript code
var txtTitle=document.getElementById('<%=TextBox1.ClientID%>');
var txtTitle1=document.getElementById('<%=TextBox2.ClientID%>');
if(txtTitle.value==''||txtTitle1.value=='' )
{
alert("输入不能为空");
}
if (txtTitle.value.length < 6 || txtTitle.value.length > 16)
{
alert("输入长度必须在6个字符到16字符之间");
}