On a course booking page I have 2 buttons, back and next. This allows them to select a course, then a location, then a date, then how many places, then enter candidate names. I solved this problem by putting the "next" button in the xhtml first, and using css to float them.
But on my shopping cart page, I have a image input delete button and a quantity box for each item. I have a "refresh" button at the bottom of the cart which when pressed will update the cart with any changed quantities. I also have "next" button which proceeds onto the next step of the order.
Ideally I would like the "refresh" button to be the one to react to the user hitting the enter button, incase someone changes a quantity and hits enter. But at the moment it seems the first delete button on the page gets submitted by hitting return.
I am using PHP to determine which button has been pressed. For example:
PHP Code:
if (isset($_POST['btnRefresh']))
{
// recalculate cart
}
else if (isset($_POST['btnNext']))
{
// go to step 2 of the order process
}
// display cart