根据标志状态启用和禁用文本框 [英] Enabling and disabling a text box according to Flag status

查看:80
本文介绍了根据标志状态启用和禁用文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,
我想根据标志状态启用和禁用我的文本框,例如,我的文本框很少.如果标志状态为Y ...启用该框...如果N则禁用该框

Dear All,
I want to eable and disable my text box according to the flag status.eg.I have few text box .If the flag status is Y ...enable the box...and if N then disable the box

推荐答案

这样做.问题是什么 ?使用jquery比仅使用javascript容易得多.
So do it. What is the problem ? Using jquery is much easier than just using javascript alone.


if(flag == "Y")
    document.getElementById("TextboxId").disabled = false
else
    document.getElementById("TextboxId").disabled = true;



就是这么简单!



As simple as that!


这篇关于根据标志状态启用和禁用文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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