Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect from combo box selection

Status
Not open for further replies.

BKer

Programmer
Apr 17, 2001
62
US
I have tried many different ways to accomplish this and have not been able to get it to work. I would like to have a simple combo box that contains logical names and values that allow navigation of a website. I got it to work with window.open in a function, but I would rather have the option selected redirect to the same window and not a new one when the user clicks a submit button.

<script language=&quot;Javascript&quot;>
function selectBrowseTo(form) {
for (var i = 0; i < form.catTitle.options.length; i++) {
if (form.catTitle.options.selected) {
//alert(&quot;You have selected &quot; + form.catTitle.options.value);
window.open('.selected,'_top');
}
}
}
</script>

<form method=&quot;post&quot; name=&quot;rentalform&quot;>
<select name=&quot;catTitle&quot; class=&quot;Pulldown&quot;>
<option value=&quot;Select One&quot;>Select one</option>
<option value=&quot;aboutus.htm&quot;>About Us</option>
<option value=&quot;home.htm&quot;>Home</option>
<option value=&quot;links.htm&quot;>Links</option>
</select>
<input type=&quot;submit&quot; onclick=&quot;selectBrowseTo(this.form)&quot;>
</form>


thanks in advance for the help
Brian Kelleher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top