Collection of Helpful Guides & Tutorials! in the input, as it is read-only. I appreciate the response, but its doesnt seem to be working for me - do you mind checking: Awesome - thanks Vijay, i just had to make the body reference have - just in case anyone sees this in the future. What was the significance of the word "ordinary" in "lords of appeal in ordinary"? Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. Then, a JavaScript can remove the readonly value, and make the input field editable. How to submit form data use jquery form in asp.net? How do I include a JavaScript file in another JavaScript file? You can get the input element and then set its readOnly property to true as follows: Call this onLoadBody() function on body tag like: The above answers did not work for me. Use setAttribute() Method to add the readonly attribute to the form input field using JavaScript. Configure a Workflow Using the Wizard. How to disable text selection highlighting, How to store objects in HTML5 localStorage/sessionStorage. Stop requiring only one assertion per unit test: Multiple assertions are fine, Going from engineer to entrepreneur takes more than just good code (Ep. None of my JavaScript scripts works. Naturally you won't see the caret (= "bar toggle"?) Here you have example how to set the readonly attribute: