• Post Reply 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

request Object doesn't contain disabled textfield values

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when we disabled any textfield from html code.
then when we submit the form to servlet,
then request Object doesn't contain disabled textfield values.
I mean we cannot get that disabled textfield name in request.
Can i know why is it happening?

Any Suggestions will be appreciated..........
[ December 10, 2008: Message edited by: ShaikSalam Bashoeb ]
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically, you are the one "set" the value of the disabled text. The user cannot enter/modify and the form is sumnitted back. The values are not returned and you don't need them because you already "know" what you have set earlier.. isn't it???

Cheers!!
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want the value back when the form is submitted but you don't want the user to be able to change it, set the input field's readonly property.
As mentioned earlier, disabled form fields don't exist when the form is submitted.

This section of the HTML spec explains the difference between readonly and disabled fields:
http://www.w3.org/TR/html401/interact/forms.html#h-17.12
[ December 10, 2008: Message edited by: Ben Souther ]
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I faced this issue in my last project.... i am too new to the technology to comment on why this happens, but whenevr we try to submit a page to a servlet, i found that only the enabled fields get passed with the form.... wht i did was, I submitted the form through a javascript function which i called on the onclick event of the submit button, and before submitting, I enabled the fields....


See if it works for you too,
Best Of Luck!
 
ShaikSalam Bashoeb
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by ShaikSalam Bashoeb:


Testing reply


Thanks for all of yours valuable suggestions, I have already solved this problem in my project, But my intention for asking this question was to know why we are not getting disabled field values from java through

and one more point i want to add is until we select any radio button we are not getting that perticular radio button name from request Object
'

If anyone says gives correct suggestion then i believe he is too brilliant.

Millions of Thanks in Advance......
 
Ranch Hand
Posts: 826
Eclipse IDE Oracle Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by ShaikSalam Bashoeb:

Thanks for all of yours valuable suggestions, I have already solved this problem in my project, But my intention for asking this question was to know why we are not getting disabled field values from java through

and one more point i want to add is until we select any radio button we are not getting that perticular radio button name from request Object




Originally posted by Ben Souther :

As mentioned earlier, disabled form fields don't exist when the form is submitted.


[ December 13, 2008: Message edited by: Sudipto Shekhar ]
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by ShaikSalam Bashoeb:
But my intention for asking this question was to know why we are not getting disabled field values from java through



This is just definied in the W3 HTML specification. It is certainly not caused by Java as you seem to think. Java is just the 'translator' here.

That said, I hope that you went for the 'readonly' approach -which is the only correct approach- and not for that Javascript solution posted here.
 
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic