当前位置: 代码迷 >> ASP >> 怎么用DIV+CSS来实现文本框的显示和隐藏
  详细解决方案

怎么用DIV+CSS来实现文本框的显示和隐藏

热度:267   发布时间:2012-02-25 10:01:48.0
如何用DIV+CSS来实现文本框的显示和隐藏
<tr>  
<td   colspan= "4 "   nowrap= "nowrap "> <input   type= "checkbox "   id=n   name= "IS_CASH "   checked   onClick= "aa() "   value=y>   现金方式 </td>
</tr>
<tr>
<td   nowrap= "nowrap "> 财务凭证号 </td>
<td> <input   size=26   TYPE= "text "   name= "CASH_VOUCHER "   id=a5> </td>
<td   nowrap= "nowrap "> <%if   DEBT_TYPE=0   then%> 已提取的减值准备 <%end   if%> </td>
<td> <%if   DEBT_TYPE=0   then%> <input   size=26   TYPE= "text "   name= "CASH_DEC_AMOUT "   > <%end   if%> </td>
</tr>
<tr>  
<td   colspan= "4 "   nowrap= "nowrap "> <input   type= "checkbox "   id=n   name= "IS_CASH "   checked   onClick= "aa() "   value=y>   达到方式 </td>
</tr>
---------------------------------------------------
<tr>
<td   nowrap= "nowrap "> 财务 </td>
<td> <input   size=26   TYPE= "text "   name= "CASH "   id=a5> </td>
<td   nowrap= "nowrap "> <%if   DEBT_TYPE=0   then%> 准备 <%end   if%> </td>
<td> <%if   DEBT_TYPE=0   then%> <input   size=26   TYPE= "text "   name= "CASH_DEC "   > <%end   if%> </td>
</tr>
有多个复选框和文本框当选中其中的复选框时相应的文本框可以输入内容,不选时不能输入内容,请大家帮忙

------解决方案--------------------
试试参考。

<table width= "100% " border= "1 ">
<tr>
<td colspan= "4 " nowrap= "nowrap "> <input type= "checkbox " id=n name= "IS_CASH " checked onClick= "IS_CASH_Click(this.checked) " value=y>
现金方式 </td>
</tr>
<tr>
<td nowrap= "nowrap "> 财务凭证号 </td>
<td> <input size=26 TYPE= "text " name= "CASH_VOUCHER " id=a5> </td>
<td nowrap= "nowrap "> <%if DEBT_TYPE=0 then%> 已提取的减值准备 <%end if%> </td>
<td> <%if DEBT_TYPE=0 then%> <input size=26 TYPE= "text " name= "CASH_DEC_AMOUT " > <%end if%> </td>
</tr>
<tr>
<td colspan= "4 " nowrap= "nowrap "> <input type= "checkbox " id=n name= "IS_CASH " checked onClick= "aa() " value=y> 达到方式 </td>
</tr>
---------------------------------------------------
<tr>
<td nowrap= "nowrap "> 财务 </td>
<td> <input size=26 TYPE= "text " name= "CASH " id=a5> </td>
<td nowrap= "nowrap "> <%if DEBT_TYPE=0 then%> 准备 <%end if%> </td>
<td> <%if DEBT_TYPE=0 then%> <input size=26 TYPE= "text " name= "CASH_DEC " > <%end if%> </td>
</tr>
</table>
<script language= "javascript ">
function IS_CASH_Click(checked){
alert(checked);
if (checked==true){
document.all.CASH_VOUCHER.disabled=false;
document.all.CASH_DEC_AMOUT.disabled=false;
}
else{
document.all.CASH_VOUCHER.disabled=true;
  相关解决方案