One trick is to get the ActionForm to do the work:

http://husted.com/struts/tips/001.html

-Ted.

Ashish Kulkarni wrote:

> hi 
> But cant i do it in my action class instead in javascript,??
>  
>  Ravi Kora wrote:Have a javascript function in the href tag like below.
> 
> 
> The javascript function submitAct will have sth like below
> function submitAct(index){
> if (index==0) {...}
> document.forms[0].submit();
> } 
> 
> Hope this helps. Bye
> -Ravi
> 
> 
> 
> Thanks & Regards,
> Ravi Kora
> [EMAIL PROTECTED]
> 337-739-3434(M) 
> 
> -----Original Message-----
> From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, September 03, 2002 11:50 AM
> To: Struts Users Mailing List
> Subject: html:submit and Image instead of button
> 
> 
> 
> Hi,
> 
> I have 4 buttons on an jsp page, but what if i have to use image instead
> of buttons,
> 
> like Add
> 
> will have a button with Add Text, and then in my Action class i can find
> out which button has been pressed, 
> 
> but what if i have to use Image instead of a button, like how can i find
> out which image was clicked if i have 4 images on a jsp with
> value="sumbit"
> 
>  [input] src="images/en/buttons/login_off.gif" width="75" height="24"
> onMouseOut="MM_swapImgRestore()"
> onMouseOver="MM_swapImage('login','','images/buttons/login_on.gif',1)" >
> 
>  [input] src="images/en/buttons/signoff_off.gif" width="75" height="24"
> onMouseOut="MM_swapImgRestore()"
> onMouseOver="MM_swapImage('signoff','','images/buttons/signoff_on.gif',1
> )" >
> 
> the above are 2 tags with same one action="/pages/selectenv">
> 
> so how will i come to know which image was clicked, what is the best way
> to do it
> 
> Ashish
> 
> 
> A$HI$H
> 
> 
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> 
> 
> --
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 
> 
> 
> A$HI$H
> 
> 
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> 


-- 
Ted Husted, Husted dot Com, Fairport NY US
co-author, Java Web Development with Struts
Order it today:
<http://husted.com/struts/book.html>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to