Win a copy of The Java Performance Companion this week in the Performance forum!
    Bookmark Topic Watch Topic
  • New Topic

Readable Text Field

 
Shrikanth Nekkanti
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 134
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
    Bookmark Topic Watch Topic
  • New Topic