1internet Posted March 21, 2013 Share Posted March 21, 2013 I am not entirely sure what this is called, but say for example you have some text on a site, and you want to edit it right there and then, and you just click on the text, and it changes to a text field and you edit the text, then onblur it updates the text with the new content form the text field. What is this called, and what is the best and easiest method of doing it? Quote Link to comment Share on other sites More sharing options...
nogray Posted March 21, 2013 Share Posted March 21, 2013 I think it's called "Edit in Place" Quote Link to comment Share on other sites More sharing options...
Drongo_III Posted March 21, 2013 Share Posted March 21, 2013 (edited) I am not entirely sure what this is called, but say for example you have some text on a site, and you want to edit it right there and then, and you just click on the text, and it changes to a text field and you edit the text, then onblur it updates the text with the new content form the text field. What is this called, and what is the best and easiest method of doing it? Best way to do it... There are lots of methods for achieving this but all depends on how complex you want to make it. If you need the fields to be draggable or sortable then you may opt for a different option but what follows is a simple example to highlight how easy it is. Just as a quick illustration (and i am typing this directly in so sry if it doesn't work) <form> Country: <input type="text" name="someField" value="WHATEVER" onblur="this.style.border='0px'; setAttribute('readonly','true')" onfocus="this.style.border='1px solid black'; removeAttribute('readonly','0')"> </form> Edited March 21, 2013 by Drongo_III Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.