解决方案 »
- 在服务器不支持泛解析的情况下,如何实现二级域名绑定
- asp.net 的 web service 到底是干啥的?
- WebGrid.NET中怎么读取ColumnType=CheckBox中的被选中项??
- cookies页面加载问题
- vs2005初级问题:如何使用.vb文件中的类?
- 那位大大有比较不错的自定义分页控件啊 帮忙提供一个,万分感激!
- 问个小问题
- csdn的高手们请进。请问如何打印指定的url的web page,提问了数次都无人能给出满意的答案
- 加入*.inc文件后的错误
- 哪里有CSDN菜单的源码啊?能让小弟学习一下吗?
- repeater控件如何获得内部的repeater控件
- 怎样做2级菜单及导航菜单
if (document.getElenmentById(txtWebUrl).Value.Length < 12) {
alert("请输入正确的网站域名!");
document.getElenmentById(txtWebUrl).focus();
return false;
}
}
我觉得是不是form的id和name名称不能是一样的
Value -> value
<script type="text/javascript">
function CheckForm() {
if (document.form1.txtWebUrl.value.length < 12) {
alert("请输入正确的网站域名!");
document.form1.txtWebUrl.focus();
return false;
}
alert("验证通过!");
}
</script>可“验证通过”也没有提示,所以应该不是js里面的问题,估计是调用的问题,我调用的代码前面给出了,大家帮忙看看
2.value 小写
3.好像是在方法的每条路都要返回才行
<script type="text/javascript">
function CheckForm() {
if (document.form1.txtWebUrl.value.length < 12) {
alert("请输入正确的网站域名!");
document.form1.txtWebUrl.focus();
return false;
}
alert("验证通过!");
return true;
}
</script>
if (document.getElementById('txtWebUrl').value.length < 12) {
alert("请输入正确的网站域名!");
document.getElementById('txtWebUrl').focus();
return false;
}
alert("验证通过!");
}
function CheckForm() {
var txtWebUrl=<%=txtWebUrl.clientId%>;
if (txtWebUrl.value.length < 12) {
alert("请输入正确的网站域名!");
txtWebUrl.focus();
return false;
}
}
</script>
用了母板 就得将document.getElementById('txtWebUrl')改为document.getElementById("<%=txtWebUrl.ClientID%>")
function CheckForm() {
if (document.form1.txtWebUrl.value.length < 12) {
alert("请输入正确的网站域名!");
document.form1.txtWebUrl.focus();
return false;
}
else
{
alert("验证通过!");
return true;
}
}
</script>
能够验证了,上面的问题解决了,可再请教个问题,就是提示“不能为空了”,可紧接着就提示“系统信息修改完成”,为什么会执行btnSubmit_Click呢???
protected void btnSubmit_Click(object sender, EventArgs e)
{
WKM_WebConfig configInfo = WKM_WebConfigManager.GetWKM_WebConfigInfo();
configInfo.Web_Url = this.txtWebUrl.Text;
WKM_WebConfigManager.ModifyWKM_WebConfig(configInfo);
Response.Write("<script>alert('系统信息修改完成');location.href='WebConfig.aspx';</script>");
}