You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Minerva CC <mi...@yahoo.com> on 2007/04/10 22:11:21 UTC

How to pass a Javascript variable to Struts parameter?

Hi,

I tried to pass a Javascript variable to a struts url tag and I did it as follow:

In the Javascript part:
var id_ = 10;

In the struts tag par:
<s:url action="myAction" id="myUrl">
<s:param name="id" value="%{id_}" />
</s:url>

But, it didn' work. Would somebody tell me how to do it?

Thanks in advance for you help.
Willa


       
____________________________________________________________________________________
TV dinner still cooling? 
Check out "Tonight's Picks" on Yahoo! TV.
http://tv.yahoo.com/

Re: How to pass a Javascript variable to Struts parameter?

Posted by Musachy Barroso <mu...@gmail.com>.
Tags are evaluated on the *server* side, javascript runs on the *client*
side. Can you give more details on what you are trying to do?

regards
musachy

On 4/10/07, Minerva CC <mi...@yahoo.com> wrote:
>
> Hi,
>
> I tried to pass a Javascript variable to a struts url tag and I did it as
> follow:
>
> In the Javascript part:
> var id_ = 10;
>
> In the struts tag par:
> <s:url action="myAction" id="myUrl">
> <s:param name="id" value="%{id_}" />
> </s:url>
>
> But, it didn' work. Would somebody tell me how to do it?
>
> Thanks in advance for you help.
> Willa
>
>
>
>
> ____________________________________________________________________________________
> TV dinner still cooling?
> Check out "Tonight's Picks" on Yahoo! TV.
> http://tv.yahoo.com/




-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd