[Javascript] Re: one form, two submit ways

Matthew Palmer mpalmer at hezmatt.org
Thu Feb 17 05:45:09 CST 2005


On Thu, Feb 17, 2005 at 12:32:31PM +0100, Michael Borchers wrote:
> <form action="script.php" name="form>
> ...
> some inputs
> ...
> 
> <select name="subaction">
> option book
> option print
> 
> submit ???
> 
> </form>
> 
> 
> the subaction later decides what to do with the data.
> 
> now i would like to leave out the select for subaction
> and offer two submit buttons with "book" and "print"
> but with the same effect.

Assuming that subaction is processed on the server, I'd presume that

<input type="submit" name="subaction" value="book">
<input type="submit" name="subaction" value="print">

Would do the job.  If subaction is processed in an onChange or onSubmit
handler, then you can just keep the same basic code and just add onClick
handlers to your two submit buttons.

- Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20050217/446d3fb7/attachment.pgp>


More information about the Javascript mailing list