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?.
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.
var sum = (number1 + number2); $('#sum'). val(sum);
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With