Hi,

I see two solution for this.

1) For each button, you can define a different form with a different action
attribute


2) You can use a javascript function to change the action attribute

Ex:
<script language=JavaScript>
        function doSubmit(val) {
                if (val==1) {
                        document.forms.consult.action='/save.do';
                }
                else if (val==2) {
                        document.forms.consult.action='/remove.do';
                }
                document.forms.consult.submit();
        }
</script>

<html:form name="consult" type="ActionForm" action="/save.do">

<input type=button class=simpletext value=Valider
onClick="doSubmit(1);return false;">
<input type=button value="Delete" class="simpletext" onClick="if
(confirm('Etes vous certain de vouloir supprimer cet enregistrement ?'))
doSubmit(2); return false;">

</html:form>

Hope it will help,

Renato

----- Original Message -----
From: "Ashish Kulkarni" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, August 29, 2002 4:31 PM
Subject: Struts and Many Buttons on Single page


>
> Hi,
>
> I am developing a struts applicatian, I have a jsp page where i have 5
buttons, say Add, Change,Delete, Display.
>
> When i click these buttons they must call different jsp with different
parameters, how can i do it???
>
> Ashish
>
>
> 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]>

Reply via email to