tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross, Douglas" <DR...@Kronos.com>
Subject RE: Submit Button
Date Tue, 07 Sep 2004 14:58:02 GMT
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:halonso@atg.com.uy] 
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" <michael@michaelmcgrady.com>:
>
> >> 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: taglibs-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
taglibs-user-help@jakarta.apache.org
> >>
> >>
>
>
>David Schwartz
>Array Software Inc.
>http://www.arrayone.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message