使文本可编辑或不可编辑 [英] Make text editable or uneditable

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

问题描述

嗨我有一个名为edit的输入按钮,如何在按下编辑时jquey / javascript使我的文本框无法编辑,编辑按钮被更改为保存而不刷新页面并且文本框变为可编辑

解决方案

只需禁用它。它将使文本不可编辑,并为用户提供适当的视觉反馈。它的一个重要好处是这种行为是用户最期待的。



使用jQuery:

 someElementWrapper = 


#someId);
// ...
someElementWrapper.prop(' disabled' true );
// ...
someElementWrapper.prop(' disabled' false );

有关详细信息,请参阅:

http:/ /stackoverflow.com/questions/1414365/disable-enable-an-input-with-jquery [ ^ ]。



-SA

Hi I have a input button called edit , how can jquey/javascript make my textbox uneditable when press edit , edit button which be changed to save without page refresh and textbox become editable

解决方案

Just disable it. It will make the text non-editable and provide appropriate visual feedback to the user. An important benefit of it is that such behavior is the most expected by the users.

With jQuery:

someElementWrapper =


("#someId"); // ... someElementWrapper.prop('disabled', true); // ... someElementWrapper.prop('disabled', false);

For some more detail, please see:
http://stackoverflow.com/questions/1414365/disable-enable-an-input-with-jquery[^].

—SA


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

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