Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to get the value of disabled text box in our next jsp but i am getting null value

Tags:

html

jsp

I want to get the value of disabled text box in our next jsp but I am getting a NULL value. Any idea what might be going wrong?.

like image 957
Sanjeev Avatar asked Sep 21 '10 06:09

Sanjeev


People also ask

How do you get disability field value?

If you make the value readonly, instead of disabling it, the field's name/value will be sent with the rest of the non-disabled fields. Make the readonly fields' focus event handler pass the focus to the next eligible field, to make it act more like a disabled element.

How get textbox value from disabled in PHP?

var sum = (number1 + number2); $('#sum'). val(sum);

What will happen when the disabled value is submitted?

If a field is disabled , the value of the field is not sent to the server when the form is submitted. If a field is readonly , the value is sent to the server.


1 Answers

Input fields marked with disabled="disabled" never send their value to the server when the form is posted. You could use the readonly="readonly" attribute in order to still make the field not editable by the user but send the initial value to the server when the form is submitted.

like image 135
Darin Dimitrov Avatar answered Oct 27 '22 02:10

Darin Dimitrov