服务器代码如下:<asp:CheckBox id=cbQutation runat="server" Enabled="false">
</asp:CheckBox> 如何通过JS使该控件重新启用?
PS:disabled=true  不行
其在前台生成的代码如下:<span disabled="disabled"><input id="dgOther__ctl3_cbQutation" type="checkbox" name="dgOther:_ctl3:cbQutation" disabled="disabled" /></span>大家帮忙看下,出出主意哈:)。

解决方案 »

  1.   

    document.getElementById("dgOther__ctl3_cbQutation").setAttribute("disabled","");
      

  2.   

    不起效果,查看源还是<span disabled="disabled"><input id="dgOther__ctl4_cbQutation" type="checkbox" name="dgOther:_ctl4:cbQutation" disabled="disabled" /></span>
      

  3.   

    Enable是服务器端的属性,可以的我现在想在客户端通过JS改
      

  4.   


    //removeAttribute() 也用了还是不行 
      

  5.   

    Enabled="false"不要这样写,如果你希望 是不可用的, 用 js 设置
      

  6.   

    明白阿非的意思,用服务器控件是为了DataBind的
      

  7.   

    问题解决了if(IsAbled)
                        {
    OtherTable.rows[i-1].cells[1].innerHTML = "<FONT face=宋体></FONT>&nbsp;&nbsp;<span disabled><input id=dgOther__ctl"+i+"_cbQutation type=checkbox name=dgOther:_ctl"+i+":cbQutation disabled /></span>";
                        }
                        else
                        {
                            OtherTable.rows[i-1].cells[1].innerHTML = "<FONT face=宋体></FONT>&nbsp;&nbsp;<input id=dgOther__ctl"+i+"_cbQutation type=checkbox name=dgOther:_ctl"+i+":cbQutation checked=true />";
                        }
    //直接拼接Html语句了...还在测试,希望没有什么后续BUG
      

  8.   

    disabled=""肯定行的
    LZ看看清一下IE缓存之类的
      

  9.   

    多谢提醒,新建了一个白板的页面,成功启用
    考虑了一下,因为是服务器控件会自动在checkbox前加个disabled的span<span disabled="disabled">...</span>所以,我刚开始改了后没出效果。谢谢大家,
    结贴了!