Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with Action Errors in Struts

 
satheesh krishnaswamy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic