[Javascript] selecting between multiple submit buttons

jm jm5379 at gmail.com
Sun Jul 22 08:37:17 CDT 2007


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



<script language=\"javascript\">
		//<![CDATA[
			window.onload=requiredFields;

			function requiredFields()
			{
				window.onsubmit=testValue;
                        }

// ... (other functions)

		//]]>
	</script>



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


since this is a gmail account, please verify the mailing list is
included in the reply to addresses



More information about the Javascript mailing list