asp 复选框和文本框联动的问题??? 高手帮忙!
想达到的效果 :
选中复选框的时候,文本框为只读.并显示指定值.
当取消复选框时,文本框恢复可写,并清空文本框中内容..
我这段代码的问题,如果选中复选框文本框可以显示指定值同时也变为只读(readOnly). 可不刷新页面取消复选框之后,文本框还是保持不可编辑(readOnly)内容也不会清除.. 该怎么写呢? 各位高手帮忙了
<Input Type= "checkbox " name= "ToolCollocate " ID= "Checkbox1 " onclick= "if(this.checked){ControlIDID.readOnly=true;}{document.all.ControlID.value= '640c07ba-098b-4cfa-b89a-09498c6ffa9b ';}else " value= "1 ">
协议ID <input id= "ControlIDID " type= "text " size= "20 " value= " " name= "ControlID " style= "WIDTH:260px " onchange1= "onclick ">
------解决方案-------------------- <Input Type= "checkbox " name= "ToolCollocate " ID= "Checkbox1 " onclick= "if(this.checked){ControlID.readOnly=true;document.all.ControlID.value= '640c07ba-098b-4cfa-b89a-09498c6ffa9b ';}else{ControlID.readOnly=false;document.all.ControlID.value= ' ';} " value= "1 ">
协议ID <input type= "text " size= "20 " value= " " name= "ControlID " style= "WIDTH:260px " onchange1= "onclick ">