default submit button in multi-button form

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi guys,

I have a web form that currently looks like this:

(Title) (Firstname) (Lastname)     [Delete]
(Title) (Firstname) (Lastname)     [Delete]
(Title) (Firstname) (Lastname)     [Delete]

[Save names]

()=text field

At the moment pressing return while in one of the text fields activates the
[Delete] button next to it, which isn't a very good default behaviour. Is
there any way to specify a default button? I'd like it to select the
[more...] button to add a new row when return is pressed. (preferably
without relying on JavaScript)

Andrew Crowe

Adaptive Technologies Ltd
13 Brunswick Square
East Sussex

01273 728128

Re: default submit button in multi-button form

Quoted text here. Click to load it

Funny, I was just dealing with this last night :-)

To the best of my knowledge, it seems that pressing enter will activate the
closest submit button that is "below" the current form item.  I don't know
of any tag to specify the default.

However, I'd try experimenting with buttons (not submits, but
type="button") that have javascript behind them (not your preferred
solution), or perhaps using form images as the delete submits (not sure if
they would get passed over), or alternately, make the delete button a link
pointing to a script (delete.php?firstname=foo&lastname=bar).

Just my .02.

Datarealm Internet Services, Inc.
Shared Hosting:
Dedicated Hosting:

Re: default submit button in multi-button form

Quoted text here. Click to load it

Such things often happen, unfortunately. But it is browser-dependent.

Quoted text here. Click to load it

There isn't.

The long story is at

The short story is that if you can, avoid putting several submit
buttons into a form. For example, instead of several "Delete" buttons,
put checkboxes before each item that indicates a deletable entry, and
include one "Delete marked items" button.

Yucca, /
Pages about Web authoring:

Site Timeline