in reply to two submit buttons in a form

or maybe, you can use a radio button (like the ones for the voting system here) and one submit.

<input type="text" value="" name="buddyname"><br> <input type="radio" name="action" value="add"> Add Buddy <br> <input type="radio" name="action" value="remove"> Add Buddy <br>
and later on...
my $action = $q->param('action'); # this is assuming you're using CGI. +pm; if ($action eq 'add') { &addBuddy; else { &deleteBuddy; }

As far as I can see, this is way better than two submits.


Chady | http://chady.net/

Replies are listed 'Best First'.
Re: Re: two submit buttons in a form
by turnstep (Parson) on Mar 12, 2001 at 19:38 UTC

    But this is much worse from a user interface perspective, as it requires one to two clicks, as opposed to just one. It also introduces more of a chance of error, since the same button does adding and deleting. (Not to mention that both your buttons are labelled "Add User" *grin*)