wood burning stoves 2.0*
The moose likes Struts and the fly likes hide/show textfields in struts form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "hide/show textfields in struts form" Watch "hide/show textfields in struts form" New topic
Author

hide/show textfields in struts form

Aruna Ponaka
Greenhorn

Joined: Dec 08, 2009
Posts: 8

I have a struts form, in the form depending on the select option the textfields should show/hide. Am using jquery for show/hide textfields. When I keep the theme as "simple", The textfields hide and on option selection they show up but the label of the textfield does not show up and the alignment is bad. If the Theme is "ajax" or "qxhtml" or "xhtml", the textfields hide/show properly but the labels of textfields do not hide. Is there a good compromise between the layout and the hide/show functionality?


My html:




jquery script:




I tried to change theme on the fly using jquery, but even that didnt work out. The hiding of content is working fine for me , but not the textfields.

Thanks,
-Aruna
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

This is probably caused by how the final HTML for the page is rendered. In your browser you should view the source of the page using the different styles to see what the differences are.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: hide/show textfields in struts form
 
Similar Threads
Problem with Dependent dropdown
How to get Struts select tag's current selected value/id
How to use struts2 submit tag as button without submitting the form ?
how to hide and show contents with struts2 div tag
<s:select onchange="changeAmt()"> not working