File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Non editable text box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Non editable text box" Watch "Non editable text box" New topic

Non editable text box

Aravind JAI

Joined: Feb 06, 2006
Posts: 18
I have a textbox with browse button. User can browse thro browse button only. He can't type anything in the text box. If he tries to enter any value in that test box, it has to throw an alert message. Please Give me sample code . Thankx in advance.
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
To make a text box non editable , you can use the readonly attribute in the inputtag like

But it wont give you any alerts.

Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
I think you are talking about the file input? If that is the case you can not control the textbox seperate from the button.

I agree. Here's the link:
subject: Non editable text box
It's not a secret anymore!