日期:2014-05-16  浏览次数:20431 次

struts通过javascript使按钮变灰为不可用,灰色按钮

struts页面用javascript来实现使按钮的变灰

Html代码 复制代码 ?
  1. < html:form ? action = "12.do" ? method = "post" > ??
  2. < html:button ? property = "bb" ? onclick = "test();" > 退出 </ html:button > ??
  3. </ html:form > ??
  4. ??
  5. < script ? language = "javascript" ? type = "text/javascript" > ??
  6. function?test() ??
  7. {??? ??
  8. ?document.forms[0] .bb.disabled ???=??? true ???;??? ??
  9. } ??
  10. </ script > ??
<html:form action="12.do" method="post">
<html:button property="bb" onclick="test();">退出</html:button>
</html:form>

<script language="javascript" type="text/javascript">
function test()
{   
 document.forms[0].bb.disabled   =   true   ;   
}
</script>

?按下这个按钮,他自己就变成灰色且不可点的了