This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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 ]
Srikanth Nutigattu
Ranch Hand
Joined: Oct 30, 2007
Posts: 114
posted
0
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???
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.
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....
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.
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 ]
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.