<html:select property="identityTypeId" styleId="identityTypeId" style="width:150px;" onblur="bluridType();" onfocus="bluridType2();">
<html:option value="">请选择证件类型</html:option>
<html:option value="101">身份证</html:option>
<html:option value="102">军官证</html:option>
<html:option value="103">护照</html:option>
<html:option value="104">士兵证</html:option>
</html:select><td align="right">
证件号码:
</td>
<td align="left">
<html:text property="identityId" styleId="identityId" maxlength="19" onfocus="focusIdentityId();"style=" height:15px; width:145px;" onblur="blurIdentityId();"></html:text>
</td>同上,如果选择“请选择证件类型”的话,下面的对话框可以为空,如果选择了证件类型,下面不可以为空,应该在js里怎么判断?谢谢
<html:option value="">请选择证件类型</html:option>
<html:option value="101">身份证</html:option>
<html:option value="102">军官证</html:option>
<html:option value="103">护照</html:option>
<html:option value="104">士兵证</html:option>
</html:select><td align="right">
证件号码:
</td>
<td align="left">
<html:text property="identityId" styleId="identityId" maxlength="19" onfocus="focusIdentityId();"style=" height:15px; width:145px;" onblur="blurIdentityId();"></html:text>
</td>同上,如果选择“请选择证件类型”的话,下面的对话框可以为空,如果选择了证件类型,下面不可以为空,应该在js里怎么判断?谢谢
解决方案 »
- 如何在网站添加背景音乐(要求在样式表中实现)
- post get
- 要疯了,谁帮我看下这段代码
- 关于B/S在线帮助系统的制作(效果类似MSDN在线帮助)
- 请问如何动态生成下拉列表的各项数据?
- BeanUtils.copyProperties问题
- 请高手们来解决点问题啊,急!
- 为什么写进数据库里的汉字是乱码,我已经用:response.setCharacterEncoding("gb2312");转码了啊?
- jsp群,欢迎大家加入
- 请大家,帮我看看这个 ResourceBundle and session的问题?在线等,急,急,急!!
- 麻烦高手都来帮我看一下
- 菜鸟级求助:Servlet部署文件应该怎么弄啊?
var identityId = document.getElemnetById('identityId');
if (identityType.value != '请选择证件类型' && identityId.value == ''){
alert('请输入证件号码!');
return;
}
var identityId = document.getElemnetById('identityId');
if (identityType.value != '101'&& identityId.value == ''){
alert('请输入证件号码!');
return;
}
“请选择证件类型”的value值是空,LZ的意思很简单,如果选择了证件类型,证件号码就是必填项。
所以identityTypeId的值不为空时,identityId也不能为空。var identityType = document.getElementById('identityTypeId');
var identityId = document.getElemnetById('identityId');
if (identityType.value != '' && identityId.value == ''){
alert('请输入证件号码!');
return;
}
var identityId = document.getElemnetById('identityId');
if (identityType.value != '请选择证件类型' && identityId.value == ''){
alert('请输入证件号码!');
return;
}