Troy's Blog

Life, family, work, and my experiences with products, services, stores, and the people I encounter each and every day.

My Photo
Name: Troy Pullis
Location: Minneapolis, Minnesota, United States

Friday, November 11, 2005

Javascript URL picker

The code below will create a drop down box, and selecting an option will cause the browser to open the URL of that chosen option, which is entered into the option tag's value attribute.

<form name="frmTools">
Select a tool:
<
select name="toolpicker" onchange="javascript: window.location.href=frmTools.toolpicker[selectedIndex].value">
<option value="">(choose tool)</option>
<option value="login_stats.cfm">Login stats</option>
<option value="account_stats.cfm">Account stats</option>
<option value="training_stats.cfm">Training stats</option>
</select>
<
/form>