Catalog.Com

Goto Script

The goto script is used when you want to have a form where a user can select a URL to go to from an option list or scroll-down menu.

To use the goto script you must set up your html code as a FORM, using the POST action method, and calling the cgibin/goto script. The URL to go to must come from a field on your form named "URL". For example, the form would be called with something like:

<form method="POST" action="http://www.catalog.com/cgibin/goto">

Here is an example:

<FORM METHOD="POST" ACTION="http://www.catalog.com/cgibin/goto">
<P>Select a place to go to: 
<p><SELECT NAME="URL">
<OPTION VALUE="http://www.catalog.com/cgibin/nochange">Pick a Location
<OPTION VALUE="http://www.art.net">Art on the Net
<OPTION VALUE="http://www.catalog.com">Catalog.Com
<OPTION VALUE="http://www.nw.com">Network Wizards
</SELECT> 
<INPUT TYPE="submit" VALUE="Go There">
</FORM>

Try this example:

Select a place to go to:

You can also use JavaScript to make your document jump without clicking the submit button. To do this, include the attribute:

onChange="window.open(URL.options[selectedIndex].value,'_self')" 
to your SELECT tag. For example:
<SELECT name="URL" onChange="window.open(URL.options[selectedIndex].value,'_self')" >

If you're using a browser with JavaScript enabled, try this example:

Select a place to go to:


Frames

If you are using goto in a frame, the default behavior will load the new document in the current frame. If you would prefer to have the document loaded in the entire window, use the TARGET="_top" attribute in your form:

<FORM METHOD="POST" ACTION="http://www.catalog.com/cgibin/goto" TARGET="_top">

If you are using the JavaScript example in addition to goto, "_self" should be changed to "_top":

<SELECT name="URL" onChange="window.open(URL.options[selectedIndex].value,'_top')" >

[Catalog.Com Home | Customer Information | Web Site Manager]