PDA

Click to See Complete Forum and Search --> : Doesn't work in Netscape


dvst8
Jul 6th, 2000, 07:53 AM
I have a drob down menu on a web page, and when the user select one of the items, I want the page to immediately refresh, with changes made elsewhere on the page according to what the user has selected. To accomplish this, I simulate a click of a submit button, which submits the asp page to itself...

I am using the onpropertychange event of the selection list. The following works flawlessly in IE, but does not work at all in Netscape:



<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function cost_c1_onpropertychange() {
window.document.myform1.B1.click();
}
</SCRIPT>

<html>
<body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0">
<form name="myform1" action="process.asp" method="POST">
<select name="cost_c1" LANGUAGE=javascript onpropertychange="cost_c1_onpropertychange();">
<option>Choose One</option>
<option>6200</option>
<option>6210</option>
<option>6220</option>
<option>6230</option>
</select>
<input type="submit" name="B1" value = "Go!">
</form>
</body>
</html>



This must simply be a small syntax error. If anyone can spot it, please let me know!!

Thanks

dvst8

Mark Sreeves
Jul 6th, 2000, 09:20 AM
<html>
<head>
<SCRIPT LANGUAGE=javascript>
<!--

function submitIt(){

document.myform1.submit()
}
-->

</SCRIPT>
</head>

<body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0">
<form name="myform1" action="process.asp" method="POST">
<select name="cost_c1" onchange="submitIt();">
<option>Choose One</option>
<option>6200</option>
<option>6210</option>
<option>6220</option>
<option>6230</option>
</select>
<input type="submit" name="B1" value = "Go!">
</form>
</body>
</html>

dvst8
Jul 6th, 2000, 09:59 AM
works perfectly mark. thank you much!

any idea why my code didn't work in netscape?!

/d8

Mark Sreeves
Jul 6th, 2000, 10:23 AM
I suspect that ID=clientEventHandlersJS is another IE only thing.