How do i know which button was pressed?
I have an HTML form, which is passed to a Java server page. I am using
String WhoClicked = request.getParameter ("ButtonNameHere");
but i noticed that when i click a button, its value attribute goes into the
string. for instance, with the button:
<input type="submit" name="NextRecords" value="Next">
my request puts the value "Next" into my String WhoClicked. So i thought
i could name two buttons the same name with different values, like this:
<input type="submit" name="NextorPrevious" value="Next">
<input type="submit" name="NextorPrevious" value="Previous">
Then I could just check my string to see if it was "Next" or "Previous",
so that i could know which button was clicked, but it's not working. Please
help, I'm stuck!
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL