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 How to Read Values From Read only Text 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 "How to Read Values From Read only Text field." Watch "How to Read Values From Read only Text field." New topic

How to Read Values From Read only 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.
samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
hi Shrikanth,
I am not sure if this approch will work in your case or not. But just try out this.
If the name of the text box that you have disabled is account ,just before final submit, call a javascript function ...lets say callMe() in which you will write
document.account.disable =false
and then make the final submit.
Hope this helps you .
Thanks and regards
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
Disabled fields are not meant to be posted back to the server. The only way to post them back is to enable them as discribed above.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60780

If you use readonly rather than disabled, the fields are submitted.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: How to Read Values From Read only Text field.
Similar Threads
HTML Text Filed values
Resetting fields in a form via radio button selection in a JSP
How to transfer a dynamic table value ?
Readable Text Field
How restore disabled textbox values if there is any validation error in current page.