OK, thanks Wes, I'm making progress:

This:

<s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
onclick="%{'$(' + #foo + ').request(); return false;'}"/>


Generates:

<input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
/images/unlocked.png" id="door3_0" value="Submit"
onclick="$(door3).request(); return false
;" alt="Unlocked"/>

If I use single-quotes inside, I get errors.  Double quotes as well.
Escaped double quotes give me &quot;, but what I really need is:

onclick="$('door3').request(); return false;"

Note the single quotes around 'door3', which is what #foo is.


-----Original Message-----
From: Wes Wannemacher [mailto:w...@wantii.com] 
Sent: Friday, July 10, 2009 12:09 PM
To: Struts Users Mailing List
Subject: Re: Help with JSP and javascript

On Friday 10 July 2009 11:49:04 Security Management wrote:
> Can someone suggest a way to do this:
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick='$("<s:property value="#foo"/>").request(); return false;'/>
>
> I have tried a bunch of ways, but always wind up with the &lts:property...
> in the resulting HTML, rather than '$("form1").submit()' like I need.
>
> Thanks
>

Try this - 

<s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
 onclick="%{'$(' + #foo + ').request(); return false;}'}"/>

-- 
Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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


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

Reply via email to