WordPress Code Snippets

A fresh mix of code snippets and tutorials

JavaScript redirect to URL on select


JavaScript and jQuery techniques for redirecting to the specified URL when the user makes a selection.

I use a variation of this technique in my Theme Switcha plugin.


Using regular JavaScript:

Basically the bit of inline JavaScript loads the URL specified by whichever option the user selects. As soon the selection is made, the browser loads the URL.


If you are using jQuery, you can do something like this:

Where select is the selector for the select field :)

Show Support

Like our new Facebook Page to show support!