JavaScript Input Readonly And Input Disabled
CSGNetwork FREE Source Code, Javascript Source, and Code Snippets!
CSGNetwork Custom Search
     Bookmark and Share
 
CSGNetwork
Snippets
Calculators
Top Free Apps
Home
Back



Right click this window and select "view source" in order to copy the source for this script.

JavaScript Input Readonly And Input Disabled

Miles Traveled

Minutes Traveled

Your Miles Per Hour



JavaScript Input Readonly And Input Disabled

This is a demonstration of the JavaScript input modifier "readonly" in the second input statement and the modifier "disabled" in the last input statement. Neither is in the first input statement. Readonly does not allow the value of the field to be changed, erased or "Cut or Copy and Pasted", while a normal input statement allows those options. Disabled allows modification but it is a "low lighted" field to indicate it is different. The disabled attribute can be set to keep a user from using an input field until some other condition has been met such as selecting a checkbox or a drop down. Subsequently, a JavaScript action of some type is required to remove the disabled value and make the input usable. The disabled attribute will not work with the input set to type="hidden". View the source.



Bookmark and Share
Registered® Trademark™ and CopyrightŠ 1973 - CSG, Computer Support Group, Inc. and CSGNetwork.Com All Rights Reserved