Helios,

You can also do something like this to eliminate the if tests: 
Add the value attribute to your input tags and set the name the same:

<body>
<form action="sub.html" method="get">
<input type="submit" name="submit" value="a">
<input type="submit" name="submit" value="b">
</form>
</body>

<!-- whatever the jstl code is to access the request.parameter values
-->
The button pressed was: <c:out value="${param.submit}"/>

-----Original Message-----
From: Helios Alonso [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 07, 2004 10:52 AM
To: Tag Libraries Users List
Subject: Re: Submit Button

It seems that only one submit parameter is sent.

I tried this html in Mozilla

<body>
<form action="sub.html" method="get">
<input type="submit" name="a">
<input type="submit" name="b">
</form>
</body>

And when I press the first button only the a parameter is sent (it has
no 
value cause the input element doesn't have it).

When I press the second button only the b parameter is sent.

So, I would do something like this:

<c:if test="!empty param.a">The a button was pressed</c:if>
<c:if test="!empty param.b">The b button was pressed</c:if>

At 10:31 07/09/2004 -0400, you wrote:
>Looking for JSTL - not Struts.
>
>Quoting "Michael G. McGrady" <[EMAIL PROTECTED]>:
>
> >> Karl Coleman wrote:
> >>
> >> >I believe the name of the button is passed in the request under
the name
> >> Submit.
> >> >
> >> >page.jsp?Submit=<name of your button>
> >> >
> >> >Karl
> >> >
> >>
> >> Oh, if this is all you wanted to know, and not how to use images,
blah,
> >> blah, then you can use <html:submit> and the property attribute
will
> >> pass along the value to the ActionForm.  I assumed you wanted to
know
> >> more than this, since this is just how the submit tag works and I
> >> assumed you looked at that.
> >>
> >> Michael
> >>
> >>
> >>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail:
[EMAIL PROTECTED]
> >>
> >>
>
>
>David Schwartz
>Array Software Inc.
>http://www.arrayone.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



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


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

Reply via email to