[Javascript] selecting between multiple submit buttons

Peter Brunone peter at brunone.com
Wed Jul 25 09:26:43 CDT 2007


Hi Joe,

    Since you're using Javascript anyway, why not change the buttons to input type="button", and use the onclick event handler to identify the button and call  form.submit?  Then you can add whatever you like (hidden fields, etc) into your process for the script to pick up when the page loads again.

Cheers,

Peter

----------------------------------------

From: jm <jm5379 at gmail.com>

i have a form that uses multiple submit buttons: one to select from a
dropdown list of menu options, one to add a new record or update an
existing record depending on which is appropriate at the time, and one
to delete an existing record. i use the following as the trigger for
onsubmit

sadly, it doesn't know how to distinguish between which submit button
is being selected. the few variations i've played with have no good
effect and i haven't found anything addressing multiple submit
buttons. the parameter names for the buttons are "delete_button",
"replace_record" (for adding or updating individual records) and
"select_datagroup". what have i missed so far that will allow me to
respond to a specific submit button's activation? i'm very new to js
so it'll be hard to offend me by "talking down" to me with
descriptions of what should appear to be obvious to everyone else.

thanks,
joe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20070725/591123c7/attachment.htm>


More information about the Javascript mailing list