|
-
Jul 6th, 2000, 07:53 AM
#1
Thread Starter
Addicted Member
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:
Code:
<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
Secret to long life:
Keep breathing as long as possible.
-
Jul 6th, 2000, 09:20 AM
#2
Frenzied Member
Try This!
Code:
<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>
-
Jul 6th, 2000, 09:59 AM
#3
Thread Starter
Addicted Member
thanks!
works perfectly mark. thank you much!
any idea why my code didn't work in netscape?!
/d8
Secret to long life:
Keep breathing as long as possible.
-
Jul 6th, 2000, 10:23 AM
#4
Frenzied Member
I suspect that ID=clientEventHandlersJS is another IE only thing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|