javascript代码: function ChkPersonal_onclick() {
if ( ChkPersonal.checked )
{
TxtPersonName.style.display = "";
CboOrgan.style.display = "none";
}
else
{
TxtPersonName.style.display = "none";
CboOrgan.style.display = "";
}
}
Struts标签: <html:select styleClass="ComboStyle" styleId="CboOrgan" style="WIDTH: 50%" property="infoSourceName">
<html:options collection="infoSourceList" property="infoSourceName" labelProperty="infoSourceName" />
</html:select>
<html:text styleClass="TxtStyle" styleId="TxtPersonName" style="DISPLAY: none; WIDTH: 50%" property="infoSourceName" />
<INPUT id="ChkPersonal" onclick="return ChkPersonal_onclick()" type="checkbox" name="ChkPersonal">个人发布问题:我想点击"个人发布"后让"html:select"的内容隐藏,但是javascript代码不能执行,请高手帮忙看看那个地方错了!
在线等,谢谢.
if ( ChkPersonal.checked )
{
TxtPersonName.style.display = "";
CboOrgan.style.display = "none";
}
else
{
TxtPersonName.style.display = "none";
CboOrgan.style.display = "";
}
}
Struts标签: <html:select styleClass="ComboStyle" styleId="CboOrgan" style="WIDTH: 50%" property="infoSourceName">
<html:options collection="infoSourceList" property="infoSourceName" labelProperty="infoSourceName" />
</html:select>
<html:text styleClass="TxtStyle" styleId="TxtPersonName" style="DISPLAY: none; WIDTH: 50%" property="infoSourceName" />
<INPUT id="ChkPersonal" onclick="return ChkPersonal_onclick()" type="checkbox" name="ChkPersonal">个人发布问题:我想点击"个人发布"后让"html:select"的内容隐藏,但是javascript代码不能执行,请高手帮忙看看那个地方错了!
在线等,谢谢.
解决方案 »
- oracle 语句中 case when缺少右括号
- 敬请高手指教 如何发布网站(Jsp + Tomcat + 域名 + 公网固定IP)
- 求一正则表达式
- WebSphere6.1.0.19部署struts2工程 控制台出错 求助~~
- 请问在jsp中怎样禁止用户用 浏览器 上的"后退"钮回到前面访问的页面!!谢谢大家!!
- struts action
- 怎样知道,表里面有多少个字段,字段名是什么?~如何列出来呢~?
- 谁有在 Jsp 中过虑和还原 Sql 语句中的非法字符的函数??
- 请教我的JDBC连接不上ORACLE8.1.7
- 请问如何在Win2000下配置JDK1.2.1和JSWDK?
- servlet编译问题
- 我用JSP调用javabean,刷新14次就刷出异常
<div id="Oo"><html:select styleClass="ComboStyle" styleId="CboOrgan" style="WIDTH: 50%" property="infoSourceName">
<html:options collection="infoSourceList" property="infoSourceName" labelProperty="infoSourceName" />
</html:select></div> 然后js改写:
function ChkPersonal_onclick() {
if ( ChkPersonal.checked )
{
TxtPersonName.style.display = "";
document.getElementById("Oo").style.display="none";//异或.innerHTML="";
}
else
{
TxtPersonName.style.display = "none";
document.getElementById("Oo").style.display=" ";
}
}试试看
这个写法也不太对啊,哥哥。将ChkPersonal这个控件作为对象获取到,然后再循环排定它的checked属性。另你不一定要用checked属性作为判断依据,也可以写一个钥匙用onchange事件作为判断。
我觉得还可以用标签的rendered属性