Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts2-populating disabled input fields after validation

 
mohan kumar r
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Query related to strut2 framework.
we have some fields in a JSP which are already filled in and disabled on form-load.we are using 'ModelDriven' approach for data transfer and validations are in XML file.

On form load, data is as below

User Name :ABC --> disabled
password:_________

after user enters the password and validating the data, no data populated for user name and the text box is empty with disabled.

user name: no data --> disabled
password : ***** error message : password should be alphanumberic

If the input field is disabled,data is not being populated after validation but it is working fine if the field is 'read only'.
Is it struts2 limitation. Please advice.

Thank you
Mohan
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not a limitation of struts2, its the standard for html. Disabled values are not submitted with the form. I think you'll want to make a hidden input field to store the value if you want it returned with the form.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic