• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Blur the field

 
anjali reddy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Waiting for reply.
anjali reddy
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our HTML/Javascript forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No JavaScript necessary, simply set the background color of the control to gray using CSS.
 
anjali reddy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Sir,you have replied as "No JavaScript necessary, simply set the background color of the control to gray using CSS."

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.

Waiting for reply!
Anjali Reddy.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic