Now, when the submit button is clicked, I want to get the value from this text field in the action class(java). On testing, I was getting "null" [getParameterValues("textfieldname") is what I have done].
When I removed the disabled, I was getting the value. So, how can I get the value while the disabled, is applied to the text field ?
Instead of disable them make them readonly.
<input type="text" name="nameOfTextField" readonly="readonly" />
if you want the field to be disabled you can use an hidden input like this:
<input type="text" id="nameVisible" disabled="disabled" /> <input type="hidden" name="nameObj" id="nameObj"/>
when you load page, you set value in both fields via DOM
in this way you'll see the input disabled on the page, and you'll get the hidden value when you submit it.