Hi, I have a text field "Name" in my jsp. When my JSP page loads I want the field "Name" to be in gray color and does not allow any of the end users to enter the information.Initially I diabled the field when the user places the cursor in that text field and does not allow them to enter the data in that field.In order to avoid confusion to the end users,I want to make the text area for that field to be in gray color so that the end users can avoid placing the cursor in that field and later they realize that they cannot enter the information in that field. Could any one tell what java script function can be written to make the field appear in gray.
But by doing the functionality specified by you, can we stop the user from entering the data in that field.If so could you let me redirect me to a place where I can find the sample examples for this functionality.
You had already indicated that you were setting the control as disabled. If not, just specify the disabled attribute. Many browsers will "gray out" the control automatically when you do so, so you may not even have to use CSS.