使用javascript启用文本框(Enabling text box using javascript)

编程入门 行业动态 更新时间:2024-10-27 02:29:16
使用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=&

本文发布于:2023-07-24 00:15:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1239145.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本框   javascript   Enabling   box   text

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!