JavaScript question

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>

                &lt;form name="form" method="post"&gt;
                  &lt;div align="center"&gt; 
                    &lt;select name="gomenu" size="1" onChange="goBrowser(this.form)"&gt;
                      &lt;option selected&gt;Select Part Number&lt;/option&gt;

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.

Unless you tell the script which pages do not exist yet, then there’s no way to do this using JavaScript. You’ll need to use a custom 404 page, server side.

are you re-directing to internal webpages only or any type of page?

At the moment, the pages are just being written. I hope to have them on a website eventually.