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 21:26:06 GMT
Sorry, I thought my shorthand was obvious.

The 1 line short hand was intended to represent any kind of String
compare:

String action = request.getParameter("action");
if("new".equalsIgnoreCase(action)){
	// action is new
}else if("edit".equalsIgnoreCase(action)){
	// or action is edit
}else if("delete".equalsIgnoreCase(action)){
	// or action is delete
}

Laziness will get me every time! Hope you didn't spend too much time
debugging this. I wil try to be more specific in the future.

-----Original Message-----
From: Michael G. McGrady [mailto:michael@michaelmcgrady.com] 
Sent: Tuesday, September 07, 2004 4:51 PM
To: Tag Libraries Users List
Subject: Re: Submit Button

Ross, Douglas wrote:

>David,
>
>I believe the browser only sends the clicked submit button value. So
the
>trick (if you would call it that) is to name all your submit buttons
the
>same:
>
><input type="submit" name="action" value="New">
><input type="submit" name="action" value="Edit">
><input type="submit" name="action" value="Delete">
>
>Whichever one the user clicks is the one sent to the server:
>
>request.getParameter("action")=="New" | "Edit" | "Delete";
>
>Hope this helps. Note: the img and the input type=image tags do not do
>this!
>
>Doug
>

This is an oops which is hard to catch.  If 
request.getParameter("action") is "New", 
(request.getParameter("action")  == "New") is FALSE.

Michael


---------------------------------------------------------------------
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