Hello, I have this code:

<select name="product" class="buy">
                  <option value="products.php" selected>Select Term</option>
                  <option value="products.php?item=1&term=1">2 Month</option>
                  <option value="products.php?item=1&term=3">3 Months</option>
                  <option value="products.php?item=1&term=6">4 Months</option>
                  <option value="products.php?item=1&term=12">5 Months </option>
                </select>

I need to make it so as soon as you click that select box, it loads the url (value)... if anyone can help me that would be great!

Thanks for your help.Here's my code again:

<select name="product" class="buy">
                  <option value="products.php" selected>Select Term</option>
                  <option value="products.php?item=1&term=1">2 Month</option>
                  <option value="products.php?item=1&term=3">3 Months</option>
                  <option value="products.php?item=1&term=6">4 Months</option>
                  <option value="products.php?item=1&term=12">5 Months </option>
                </select>

When they click the "2 Month" value, it will load http://www.mydomain.com/products.php?item=1&term=1. Do you see what I'm trying to do? Thanks

Sure. Add on onChange handler:

<select name = "product" class="buy" onChange="JavaScript:mySelect(this);">

Code the mySelect function in the head/script section:

function mySelect(x)
{
  window.location.href = "http://www.your_domain.com/"  +   
     x.options[x.selectedIndex].value;
}

Some variation of that ought to do the trick.

This article has been dead for over six months. Start a new discussion instead.