I’m working on a webpage that will use a JavaScript drop down menu. If I select a valid value, the new webpage pops up with no problems. If I select a value for which no new page exists, I get the old familiar “Page Cannot Be Displayed” error. I would really like to have my own error page pop up, but I don’t know what to change in the JavaScript—maybe I can’t do it at all.
This part of the JavaScript is in the Head portion: <script language=“JavaScript”>
function doMoveBrowser(form) {window.location.href = form.gomenu.options[getSelectedValue()].value; } function getSelectedValue() {return document.goform.gomenu.selectedIndex }</script>
The part that is in the Body is pretty long; but the first few lines are:<script language=“JavaScript”>function goBrowser(form) {document.location.href = form.gomenu.options[form.gomenu.selectedIndex].value;
form.gomenu.selectedIndex=0;} </script>
<form name="form" method="post">
<div align="center">
<select name="gomenu" size="1" onChange="goBrowser(this.form)">
<option selected>Select Part Number</option>
Is this enough information for someone to answer my question? I believe this Script, or a very similar one, is in widespread use, for what that’s worth.
I would appreciate any inputs.