NESGamepro.com - Javascript Form Redirect

These Javascript examples allow you to have a list of links on your own site. There are many ways to do this, see my Perl Form Redirect or Drop-Down Link Box Tool for even more ways to put links on your site.


The following 2 examples use the same code which is in the head of the HTML document. You can run as many select boxes from the single code as you want. Note the first one uses names for the form and select tags and the second doesn't.

Example 1

With this one, you choose your link from the select box and then click the Go button and you'll be redirected.

Example 2

This one redirects you after you change the select box to one of the links. A Go button is not needed.

Here is the Javascript code that controls those forms. It should be placed between the <head> and </head> tags.

For your convenience, the two codes above have been placed together on an example page that you can copy and play with. The zipped file contains the same HTML file.


The next 2 examples use Javascript in the form itself. There is no need for a code in the head this time, but you can still have as many select boxes as you want on a single page. Note the first one uses names for the form and select tags and the second doesn't.

Example 3

Just as with Example 1, you choose your link from the select box and then click the Go button and you'll be redirected.

Example 4

Similar to Example 2, this one redirects you after you change the select box to one of the links. A Go button is not needed.

For your convenience, the two codes above have been placed together on an example page that you can copy and play with. The zipped file contains the same HTML file.


You can also use other types of form controls as links using the Javascript from the examples listed above. The next 2 examples use the same Javascript used in the <head> of Examples 1 and 2.

Example 5


This is a button to go to a single link.

Example 6


Check the box to go to another link.
Link 2

For your convenience, the two codes above have been placed together on an example page that you can copy and play with. The zipped file contains the same HTML file.


You can even use the same code to make a "location" box. That is, a user types where they want to go, instead of you. A Javascript code in the form action is there in case someone just hits enter in the text box, but it may not work in all browsers.

Example 7


This one does not need a Javascript code in the <head>, similar to Example 3.

Example 8


Simple error checking is included with this one, it uses a slighlty modified version of the Javascript in the <head> of Examples 1 and 2.

Place this Javascript between the <head> and </head> tags for Example 8.

For your convenience, the two codes above have been placed together on an example page that you can copy and play with. The zipped file contains the same HTML file.


There are a lot of different ways to make the form look. If you know CSS styles you can make your own and add it to the form code.

Back to Home