Another JavaScript form submit question

by Keith Purtell <kpurtell(at)vantagemed.net>

 Date:  Wed, 7 Jun 2000 17:31:00 -0500
 To:  <hwg-languages-digest(at)mail.hwg.org>
  todo: View Thread, Original
This is a variation on the last question you folks answered, where selecting
an option from a drop-down menu submitted a form, and the submission
location was contained in the option value.

This time, I'm trying to submit to the location specified with ACTION, and
selecting from a drop-down menu just initiates the submission. My attempt
below tries to work but can't seem to process the target URL (path).
Numerous variations have failed ("Object doesn't support this property or
method"). I would really appreciate a bug fix! Thank you.

<SCRIPT LANGUAGE="JavaScript">
function SendTo_Page(object) {
	var path = "process_form.html";
	window.location.replace(path);
	document.myform.submit();
}
</SCRIPT>

<FORM name="myform" action="process_form.html" method="POST">
	<SELECT name="OptionNumber" size="1" onChange="SendTo_Page(this)">
	<OPTION selected value="1">First</OPTION>
	<OPTION value="2">Second</OPTION>
	<OPTION value="3">Third</OPTION>
	</SELECT>

Keith Purtell, Web Designer

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA