使用javascript启用文本框(Enabling text box using javascript)
我遵循最初禁用的文本框:
<input id="txtCustFName" name="txtRCustFName" type="text" required disabled="true"/>单击以下锚标记即可调用js以启用上述文本框: HTML:启用
JS:
EnableTxt() { document.getElementById("txtCustFName").disabled = false; }但是这段代码不起作用。 我无法启用文本框。
我怎样才能做到这一点?
I've following textbox which is initially disabled:
<input id="txtCustFName" name="txtRCustFName" type="text" required disabled="true"/>on click on following anchor tag i m calling the js to enable the above text box: HTML: Enable
JS:
EnableTxt() { document.getElementById("txtCustFName").disabled = false; }But this code is not working. I am not able to enable text box.
How can I do this?
最满意答案
您可以使用以下命令启用/禁用:
function EnableTxt() { document.getElementById( '<%=txtRCustFName.ClientID%>' ).disabled = 'false'; }You can enable/disable using this:
function EnableTxt() { document.getElementById( '<%=txtRCustFName.ClientID%>' ).disabled = 'false'; }更多推荐
disabled,文本框,text,txtCustFName,启用,电脑培训,计算机培训,IT培训"/> <meta name=&
发布评论