求技术高手给写个JS代码 使下面这个提交表单 没有输入姓名 手机号码 等前提下不能提交表单申请!谢谢
<formaction="/plus/diy.php"enctype="multipart/form-data"method="post"><inputtype="hid...
<form action="/plus/diy.php" enctype="multipart/form-data" method="post">
<input type="hidden" name="action" value="post" />
<input type="hidden" name="diyid" value="1" />
<input type="hidden" name="do" value="2" />
<table style="width:97%;" cellpadding="0" cellspacing="1">
<tr>
<td align="right" valign="top">姓名:</td>
<td><input type='text' name='xingming' id='xingming' style='width:200px' class='intxt' value='' />
</td>
</tr>
<tr>
<td align="right" valign="top">联系电话:</td>
<td><input type='text' name='lianxidianhua' id='lianxidianhua' style='width:200px' class='intxt' value='' />
</td>
</tr>
<tr>
<td align="right" valign="top">性别:</td>
<td><input type='radio' name='sex' class='np' value='男' checked>男
<input type='radio' name='sex' class='np' value='女'>女
</td>
</tr>
<tr>
<td align="right" valign="top">税后收入:</td>
<td><select name='inc' style='width:150px'><option value='请选择您的范围'>请选择您的范围</option>
<option value='2000元-2999元'>2000元-2999元</option>
<option value='3000元-3999元'>3000元-3999元</option>
<option value='4000元-4999元'>4000元-4999元</option>
<option value='5000元-5999元'>5000元-5999元</option>
<option value='6000以上'>6000以上</option>
</select>
</td>
</tr>
<tr>
<td align="right" valign="top">工资发放形式:</td>
<td><input type='radio' name='paytype' class='np' value='银行' checked>银行
<input type='radio' name='paytype' class='np' value='现金'>现金
</td>
</tr>
<tr>
<td align="right" valign="top">申请类型:</td>
<td><select name='shenqingleixing' style='width:150px'><option value='选择申请类型'>选择申请类型</option>
<option value='工薪阶层'>工薪阶层</option>
<option value='有房人士'>有房人士</option>
<option value='私营业主'>私营业主</option>
<option value='社保公积金'>社保公积金</option>
</select>
</td>
</tr>
<tr>
<td align="right" valign="top">详细内容:</td>
<td><input type="hidden" id="xiangxineirong" name="xiangxineirong" value="" style="display:none" /><input type="hidden" id="xiangxineirong___Config" value="FullPage=false" style="display:none" /><iframe id="xiangxineirong___Frame" src="/include/FCKeditor/editor/fckeditor.html?InstanceName=xiangxineirong&Toolbar=Diy" width="100%" height="350" frameborder="0" scrolling="no"></iframe></td>
</tr>
<input type="hidden" name="dede_fields" value="xingming,text;lianxidianhua,text;shenqingleixing,select;xiangxineirong,htmltext;sex,radio;inc,select;paytype,radio" />
<input type="hidden" name="dede_fieldshash" value="e2caaf47ed077c30de296ccf4356acb2" /></table>
<div align='center' style='height:30px;padding-top:10px;'>
<input type="submit" name="submit" value="提 交" class='coolbg' />
<input type="reset" name="reset" value="重 置" class='coolbg' />
</div>
</form> 展开
<input type="hidden" name="action" value="post" />
<input type="hidden" name="diyid" value="1" />
<input type="hidden" name="do" value="2" />
<table style="width:97%;" cellpadding="0" cellspacing="1">
<tr>
<td align="right" valign="top">姓名:</td>
<td><input type='text' name='xingming' id='xingming' style='width:200px' class='intxt' value='' />
</td>
</tr>
<tr>
<td align="right" valign="top">联系电话:</td>
<td><input type='text' name='lianxidianhua' id='lianxidianhua' style='width:200px' class='intxt' value='' />
</td>
</tr>
<tr>
<td align="right" valign="top">性别:</td>
<td><input type='radio' name='sex' class='np' value='男' checked>男
<input type='radio' name='sex' class='np' value='女'>女
</td>
</tr>
<tr>
<td align="right" valign="top">税后收入:</td>
<td><select name='inc' style='width:150px'><option value='请选择您的范围'>请选择您的范围</option>
<option value='2000元-2999元'>2000元-2999元</option>
<option value='3000元-3999元'>3000元-3999元</option>
<option value='4000元-4999元'>4000元-4999元</option>
<option value='5000元-5999元'>5000元-5999元</option>
<option value='6000以上'>6000以上</option>
</select>
</td>
</tr>
<tr>
<td align="right" valign="top">工资发放形式:</td>
<td><input type='radio' name='paytype' class='np' value='银行' checked>银行
<input type='radio' name='paytype' class='np' value='现金'>现金
</td>
</tr>
<tr>
<td align="right" valign="top">申请类型:</td>
<td><select name='shenqingleixing' style='width:150px'><option value='选择申请类型'>选择申请类型</option>
<option value='工薪阶层'>工薪阶层</option>
<option value='有房人士'>有房人士</option>
<option value='私营业主'>私营业主</option>
<option value='社保公积金'>社保公积金</option>
</select>
</td>
</tr>
<tr>
<td align="right" valign="top">详细内容:</td>
<td><input type="hidden" id="xiangxineirong" name="xiangxineirong" value="" style="display:none" /><input type="hidden" id="xiangxineirong___Config" value="FullPage=false" style="display:none" /><iframe id="xiangxineirong___Frame" src="/include/FCKeditor/editor/fckeditor.html?InstanceName=xiangxineirong&Toolbar=Diy" width="100%" height="350" frameborder="0" scrolling="no"></iframe></td>
</tr>
<input type="hidden" name="dede_fields" value="xingming,text;lianxidianhua,text;shenqingleixing,select;xiangxineirong,htmltext;sex,radio;inc,select;paytype,radio" />
<input type="hidden" name="dede_fieldshash" value="e2caaf47ed077c30de296ccf4356acb2" /></table>
<div align='center' style='height:30px;padding-top:10px;'>
<input type="submit" name="submit" value="提 交" class='coolbg' />
<input type="reset" name="reset" value="重 置" class='coolbg' />
</div>
</form> 展开
展开全部
<form action="/plus/diy.php" enctype="multipart/form-data" method="post">
改成
<form action="/plus/diy.php" enctype="multipart/form-data" method="post" onsubmit="javascript:return chkfrm(this);">
加入如下脚本:
<script language="javascript">
function chkfrm(frm){
if(frm.xingming.value==''){
alert('请填写姓名!');
return false;
}
if(frm.lianxidianhua.value==''){
alert('请填写联系电话!');
return false;
}
if(frm.inc.value=='请选择您的范围'){
alert('请选择税后收入!');
return false;
}
if(frm.shenqingleixing.value=='选择申请类型'){
alert('请选择申请类型!');
return false;
}
if(frm.xiangxineirong.value==''){
alert('请填写详细内容!');
return false;
}
}
</script>
改成
<form action="/plus/diy.php" enctype="multipart/form-data" method="post" onsubmit="javascript:return chkfrm(this);">
加入如下脚本:
<script language="javascript">
function chkfrm(frm){
if(frm.xingming.value==''){
alert('请填写姓名!');
return false;
}
if(frm.lianxidianhua.value==''){
alert('请填写联系电话!');
return false;
}
if(frm.inc.value=='请选择您的范围'){
alert('请选择税后收入!');
return false;
}
if(frm.shenqingleixing.value=='选择申请类型'){
alert('请选择申请类型!');
return false;
}
if(frm.xiangxineirong.value==''){
alert('请填写详细内容!');
return false;
}
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询