aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Blur the field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Blur the field" Watch "Blur the field" New topic
Author

Blur the field

anjali reddy
Greenhorn

Joined: Apr 14, 2007
Posts: 11
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

Joined: Dec 11, 2004
Posts: 13410

Moving to our HTML/Javascript forum.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

No JavaScript necessary, simply set the background color of the control to gray using CSS.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
anjali reddy
Greenhorn

Joined: Apr 14, 2007
Posts: 11
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

Joined: Jan 10, 2002
Posts: 61766
    
  67

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Blur the field