Click here to Skip to main content
15,065,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

1 solution

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:
JavaScript
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
   
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900