Have a property for that bean say
Private Sting act;
and in the jsp have a corresponding hidden tag like
<html:hidden property="act"/>
In the javascript function set the act to whatever you want depending on
the index like
function submitAct(index){
if (index==0) { document.form.act.value="act1";
}
document.forms[0].submit();
}
Finally, in the Action class get the value of the property act for the
form. Hope this helps!
-R
Thanks & Regards,
Ravi Kora
[EMAIL PROTECTED]
337-739-3434(M)
-----Original Message-----
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 12:21 PM
To: Struts Users Mailing List
Subject: RE: html:submit and Image instead of button
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
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>