function submit_check(){
if (window.document.hzinput_form.m_netname.value==""){
alert("请输入你的昵称!");
document.hzinput_form.m_netname.focus();
return false;
}
if (window.document.hzinput_form.m_age.value==""){
alert("请输入你的年龄!");
document.hzinput_form.m_age.focus();
return false;
}
if (window.document.hzinput_form.m_email.value==""){
alert("请输入你的E_mail!");
document.hzinput_form.m_email.focus();
return false;
}
if (window.document.hzinput_form.rent_money.value==""){
alert("请输入你的承受月租金!");
document.hzinput_form.rent_money.focus();
return false;
}
if (isNaN(window.document.hzinput_form.m_age.value)){
alert("年龄必须是数字!");
window.document.hzinput_form.m_age.value="";
document.hzinput_form.m_age.focus();
return false;
}
if (isNaN(window.document.hzinput_form.rent_money.value)){
alert("承受月租金必须是数字!");
window.document.hzinput_form.rent_money.value="";
document.hzinput_form.rent_money.focus();
return false;
} }
function mod_info(){
if (!submit_check()){
alert("失败");
}else{
alert("成功");
}
}帮我看看
if (window.document.hzinput_form.m_netname.value==""){
alert("请输入你的昵称!");
document.hzinput_form.m_netname.focus();
return false;
}
if (window.document.hzinput_form.m_age.value==""){
alert("请输入你的年龄!");
document.hzinput_form.m_age.focus();
return false;
}
if (window.document.hzinput_form.m_email.value==""){
alert("请输入你的E_mail!");
document.hzinput_form.m_email.focus();
return false;
}
if (window.document.hzinput_form.rent_money.value==""){
alert("请输入你的承受月租金!");
document.hzinput_form.rent_money.focus();
return false;
}
if (isNaN(window.document.hzinput_form.m_age.value)){
alert("年龄必须是数字!");
window.document.hzinput_form.m_age.value="";
document.hzinput_form.m_age.focus();
return false;
}
if (isNaN(window.document.hzinput_form.rent_money.value)){
alert("承受月租金必须是数字!");
window.document.hzinput_form.rent_money.value="";
document.hzinput_form.rent_money.focus();
return false;
} }
function mod_info(){
if (!submit_check()){
alert("失败");
}else{
alert("成功");
}
}帮我看看
解决方案 »
- 用jquery的addclass,当鼠标移到li上给li增加样式,请帮忙
- extjs的一个问题
- dojo组件滑动菜单和用cookie设置selected的问题
- 帮忙改一下,这段代码在DOCTYPE模式下运行
- 关于TreeView的讨论问题, 想发表一下的请进, 谢谢.
- 不重新 发送信息,则无法刷新网页???
- 在文本框内容改变时触发onchange事件,能否获得原来的值和新值,或者它们的改变量。
- 怎样使连接在confirm返回false时不发生跳转?
- 禁止IE F5键刷新功能。
- 如果用JS动态创建一个FORM和一些INPUT,然后提交,会不会提交成功?
- JAVASCRIPT 取得控件数组的大小
- 有个关于地址的问题,希望帮助.
........
document.hzinput_form.rent_money.focus();
return false;
}
return true; //加上这句再试试
}
function mod_info(){
if (!submit_check()){
alert("失败");
........
但如果放在mod_info这样运行总有问题