aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes text field uneditable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "text field uneditable" Watch "text field uneditable" New topic
Author

text field uneditable

Sandy Saahil
Greenhorn

Joined: Apr 06, 2006
Posts: 9
hi all...i dont knw about javascript....i want a text field which should be such that no typing is allowed in that. data in that field can be entered by only browsing....can u suggest any such script...or any pointer..

thanx in advance.


Keep Faith
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not make the text portion of the file element readonly

Eric
Zip Ped
Ranch Hand

Joined: Jul 26, 2005
Posts: 336
Use the readonly="true" attribute for the text field <input> tag.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Originally posted by Kailash Thiyagarajan:
Use the readonly="true" attribute for the text field <input> tag.


Kailash,

Sandy is talking about the type="file", try what you sugggested.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Originally posted by Eric Pascarello:

Sandy is talking about the type="file", try what you sugggested.


Unless his post has been changed, I see no mention of the file type. Perhaps his mention of "browsing" is what's confusing.

At this point I think the OP needs to clarify the question.
[ May 26, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Originally posted by Eric Pascarello:
You can not make the text portion of the file element readonly

Eric


Well, I would say not directly.
transparent div with absolute positioning ,right coordinates and z-index will actually do the impossible
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Originally posted by Yuriy Fuksenko:


Well, I would say not directly.
transparent div with absolute positioning ,right coordinates and z-index will actually do the impossible



what about me who does not use my mouse! Way too many factors that limit usability.

Eric
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Sorry for overcomplicating the matter onkeydown="retun false" seems to do the trick, at least in IE and Firefox

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Yuriy,

My point is you should not build the browser and its component around your application. Te applicaiton should be built around the browser. A lot of companies now a days are getting sued for inaccessability of their sites. Things like this are a reason. (It is an intranet application, so large companies to hire disabled people!)

What harm does typing something in do? Oh, the server does not load anything so you need to return an error message. Not hard to do. I personally use my tab key, enter key, space bar, etc to navigate a web page when I am on my tablet. I really hate using the small touch panel and I really do not feel like taking out the pen to do thigs when I can do it all from the keyboard!

Just a personal rant I have. LOL

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: text field uneditable