permaculture playing cards
The moose likes Struts and the fly likes Problems with Action Errors in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problems with Action Errors in Struts" Watch "Problems with Action Errors in Struts" New topic

Problems with Action Errors in Struts

satheesh krishnaswamy
Ranch Hand

Joined: Mar 17, 2004
Posts: 137
Hi All,

I've a dropdown and a text box.Based on the value of Dropdown(if we change the drop down) the second text box should be visible else it should not be visible.

I am first using <div id="showText" style="display:none"> and hence not displaying the second text box unless the drop down changes.

But when we submit the form and if we have Action Errors in the page(Validation issue),then when the page gets loaded,with errors populated on it,this time the Second Text Box is not visible even though the Dropdown remains the same.

Please help me out as it is pretty urgent.

Please help me out in this.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'd suggest using the onload event in your <body> tag. Have this event call the same javaScript function that the onchange event of your first dropdown calls. That way, if the first dropdown has a value, the second one will be displayed when the page is loaded.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Problems with Action Errors in Struts
It's not a secret anymore!