| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Senior Member
Join Date: Oct 2006
Posts: 2,097
|
Multiple Submit Buttons for a single form.
Just a quick one. I have used mutiple input buttons for a single form, if a user presses "enter" it seems to activate the first submit button in the source code. Is there any way of setting which button is the primary submit button, allowing it to be activated when the user hits their "enter" key? |
|
|
|
|
|
#4 (permalink) |
|
goober :-)
|
surely if you have multiple submit buttons, but within a single form, both buttons must do exactly the same thing anyway? All they do is submit the values of the form fields and the form action dictates the rest... Unless you've got some other funky stuff going on in there... ? My signature sucks.
|
|
|
|
#5 (permalink) |
|
Senior Member
Join Date: Oct 2006
Posts: 2,097
|
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:
|
|
![]() |