文本框只读更改 [英] textbox readonly change

查看:61
本文介绍了文本框只读更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个文本框。最初第二个文本框readonly属性为true。我想当我在第一个文本框中输入值时,第二个文本框readonly属性为false。

我希望使用java脚本。请建议我代码。

i have two text box. initially second text box readonly property is true. i want when i enter value in first text box the second text box readonly property is false.
i want this using java script. please suggest me code.

推荐答案

试试这个

document.getElementById(id).disabled = false;

如果这个解决方案可以帮助我。
Try this
document.getElementById(id).disabled= false;
If this solution coult help.vote me


请尝试在java脚本函数中使用


var txt2 = document.getElementById( txt2);

txt2.removeAttribute('readonly');
Please try
in java script function
var txt2 = document.getElementById("txt2");
txt2.removeAttribute('readonly');


这篇关于文本框只读更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆