只读和可编辑的文本框? [英] Readonly and editable textbox?

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

问题描述

朋友们,
如何根据条件使文本框为只读和可编辑状态?假设我想做以下事情:

Hi friends,
How to make a textbox readonly and editable on the basis of a condition? Suppose I want the following thing to do:

if(condition true)
{
    textbox should be readonly
}
else{
     textbox should be editable
}


推荐答案

将以下代码放入您的条件中-

Put the following code in your conditions -

document.form1.txt1.disabled=true;
document.form1.txt1.readonly=true;


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

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