Retrieve Parameter Value from Disabled Input

S

Sisilla

Hello All,

I am setting the value of a disabled text input form element with
JavaScript. How can I retrieve its value in Java?

request.getParameter(textInputID);

always seems to return 'null'.


I appreciate any effort to help me. Thank you for your time and
consideration.

Sincerely,

Sisilla
 
L

Lew

Sisilla said:
I am setting the value of a disabled text input form element with
JavaScript. How can I retrieve its value in Java?

request.getParameter(textInputID);

always seems to return 'null'.

<http://www.w3schools.com/tags/tag_input.asp>
The 'disabled' attribute "[d]isables the input element when it first loads so
that the user can not write text in it, or select it."

So it is never entered into the request as a parameter.

Thus a server-side attempt to retrieve this value that was never entered into
the parameter list will always receive null. Because the parameter isn't
there. Because its input was disabled.
 
S

Sisilla

Thanks, Lew. I made the element read-only instead of disabled and used
css to give it the look of a disabled element. Thanks for your help.
~Sisilla
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top