You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rajeshwari Godbole <rg...@gmail.com> on 2009/02/10 06:20:43 UTC

Hiding s:select control

Hello all,

I'm using Struts2 on Tomcat and am trying to hide a s:select tag depending
on the selected option of another s:select tag. I'm able to disable the tag
using javascript but am not able to hide it. Setting style.display="none";
does not work, neither does adding a div tag because Struts writes its own
<tr><td>'s and the div tag is placed somewhere else. Is there a way to do
this? Could struts be told not to create <tr> and <td> fields?

Any help is much appreciated.

Thanks,

Rajeshwari

Re: Hiding s:select control

Posted by Sonny Gill <so...@gmail.com>.
Whether or not the <tr> and <td> s are created depend on the theme see
are using for the form.
See http://struts.apache.org/2.0.14/docs/form.html
If you use the 'simple' theme, no extra html elements will be created.
See http://struts.apache.org/2.0.14/docs/themes-and-templates.html

Setting the element's style.display to 'none' should work. If it is
not working, you need to debug the Javascript code that you are
adding, that is not due to Struts.

Cheers,
Sonny


On Tue, Feb 10, 2009 at 1:20 PM, Rajeshwari Godbole <rg...@gmail.com> wrote:
> Hello all,
>
> I'm using Struts2 on Tomcat and am trying to hide a s:select tag depending
> on the selected option of another s:select tag. I'm able to disable the tag
> using javascript but am not able to hide it. Setting style.display="none";
> does not work, neither does adding a div tag because Struts writes its own
> <tr><td>'s and the div tag is placed somewhere else. Is there a way to do
> this? Could struts be told not to create <tr> and <td> fields?
>
> Any help is much appreciated.
>
> Thanks,
>
> Rajeshwari
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Hiding s:select control

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Rajeshwari,
it has nothing to do with struts2, use javascript for it,
also setting html id property for your selects might help.

Best greetings,
Paweł Wielgus.

2009/2/10 Rajeshwari Godbole <rg...@gmail.com>:
> Hello all,
>
> I'm using Struts2 on Tomcat and am trying to hide a s:select tag depending
> on the selected option of another s:select tag. I'm able to disable the tag
> using javascript but am not able to hide it. Setting style.display="none";
> does not work, neither does adding a div tag because Struts writes its own
> <tr><td>'s and the div tag is placed somewhere else. Is there a way to do
> this? Could struts be told not to create <tr> and <td> fields?
>
> Any help is much appreciated.
>
> Thanks,
>
> Rajeshwari
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org