Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Readable Text Field

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: https://coderanch.com/t/120785/HTML-JavaScript/Read-Values-Read-only-Text

Eric
 
All that thinking. Doesn't it hurt? What do you think about this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic