说明:
在一个表单中利用js验证其中的内容不为空
验证通过后提交服务器(使用的开发平台时VS2003)
遇到的问题是当我的文本框内容为空时提交会出现 “对象不支持此属性或方法”的警告对话框
function check()
{
var strSign=true;
if(document.Form1.txtCautionerBiryhday.value=="")
{
alert("出生日期不能为空");
document.Form1.txtCautionerBiryhday.focus();
event.returnValue=false;
strSign=false;
}
if(document.Form1.txtCautionerTime.value=="")
{
alert("担保人签字日期不能为空");
document.Form1.txtCautionerTime.focus();
strSign=false;//false;
event.returnValue=false;
}
if(document.Form1.txtVoucheeTime.value=="")
{
alert("被担保人签字日期不能为空");
document.Form1.txtVoucheeTime.focus();
event.returnValue=false;
strSign=false;
}
if(strSign==true)
{
event.returnValue=true;
__doPostBack('btnSave','');
}
else
{
document.getElementById("Form1").onSubmit();
}
}
请教高手该如何解决
在一个表单中利用js验证其中的内容不为空
验证通过后提交服务器(使用的开发平台时VS2003)
遇到的问题是当我的文本框内容为空时提交会出现 “对象不支持此属性或方法”的警告对话框
function check()
{
var strSign=true;
if(document.Form1.txtCautionerBiryhday.value=="")
{
alert("出生日期不能为空");
document.Form1.txtCautionerBiryhday.focus();
event.returnValue=false;
strSign=false;
}
if(document.Form1.txtCautionerTime.value=="")
{
alert("担保人签字日期不能为空");
document.Form1.txtCautionerTime.focus();
strSign=false;//false;
event.returnValue=false;
}
if(document.Form1.txtVoucheeTime.value=="")
{
alert("被担保人签字日期不能为空");
document.Form1.txtVoucheeTime.focus();
event.returnValue=false;
strSign=false;
}
if(strSign==true)
{
event.returnValue=true;
__doPostBack('btnSave','');
}
else
{
document.getElementById("Form1").onSubmit();
}
}
请教高手该如何解决
解决方案 »
- SQLITE虚拟主机商需要支持吗?
- 请教高手,画面传值问题。(重新发)
- 多维数组保存数据问题!
- 旅游线路系统
- 上传前 图片预览
- 求救!请问怎样实现重新定义动态数组且不清空之前的记录,谢谢
- 就要绝望了,跪求一段代码~~~~~~~~~~~~~~~
- 关于网页编辑器执行脚本execCommand("JustifyLeft",null,null);要是低于IE5.5这个版本不支持了,如何实现?谢谢!比较急,在线等!
- DataSet中两个表之间数据传递问题
- ASP.NET中如何对EXCEEL文件进行操作??
- 2005网站访问问题!!在线等,急!!!
- 另一个 SqlParameterCollection 中已包含 SqlParameter。
你将event.returnValue 直接改成 return 看看