This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Readable Text Field 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
Reply locked New topic

Readable Text Field

Shrikanth Nekkanti
Ranch Hand

Joined: Jul 12, 2007
Posts: 48
I have disabled two text fields .However when I click on submit button i want to read the values of disabled text fields.

can anyone suggest me how to resolve my problem.
[ September 24, 2007: Message edited by: Shrikanth Nekkanti ]
Tarun Yadav
Ranch Hand

Joined: Sep 20, 2007
Posts: 134
Originally posted by Shrikanth Nekkanti:
How to make text field readable in JSP.
If I disable text field values wont be submitted i suppose.
how to resolve this

Not quite sure what you're asking. You want to disable a user from editing a text field but also read the value on submitting?

You're right about disabled fields not being submitted. You could work around this in a couple of ways; put the required value in a hidden field with the required name and name the text field something else. Or you could enable the text field and use JavaScript to stop the user from editing the field by continually removing focus from the field when the user tried to select it; but this is a pretty sad hack and has the additionally vulnerability of being useless if the user disables scripting.

I would use the first method myself, can't think of anything else.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Please do not post the same question multiple times on this site. i am closing this topic, please post answers in this one here:

I agree. Here's the link:
subject: Readable Text Field
It's not a secret anymore!