wood burning stoves 2.0*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply locked New topic
Author

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
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Please do not post the same question multiple times on this site. i am closing this topic, please post answers in this one here: http://www.coderanch.com/t/120785/HTML-JavaScript/Read-Values-Read-only-Text

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Readable Text Field