This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes struts2-populating disabled input fields after validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2-populating disabled input fields after validation" Watch "struts2-populating disabled input fields after validation" New topic
Author

struts2-populating disabled input fields after validation

mohan kumar r
Ranch Hand

Joined: Jan 19, 2006
Posts: 38
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


mohan
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2-populating disabled input fields after validation
 
Similar Threads
Struts2 & validation [SOLVED]
Struts2 Validation
struts2: howto ajax-validate with annotation?
Form Validation using xml in struts2
Struts2 wizard with scoped model driven