Jump to content

Drop down list as a link


zog953

Recommended Posts

I would lke to use a drop down list, but use it as a kind of menu linked to the relevant pages. Can this be done?

<form><select name="stockists"><option value="select">Select Your Region<option value="e_anglia">East Anglia<option value="ireland">Ireland<option value="london">London<option value="midlands">Midlands<option value="n_england">Northern England<option value="scotland">Scotland<option value="s_east">South East<option value="s_west">South West<option value="wales">Wales</select></form>

Link to comment
Share on other sites

java script:<script language="javascript">function Jump(temp){ var opt_key = temp.selectedIndex; var url_val = temp.options[opt_key].value; window.open(url_val,'_top'); return true; }</script>HTML: [value attribute should contain the redirect page]<form><select name="stockists"><option value="">Select Your Region<option value="East_Anglia.htm">East Anglia<option value="ireland.htm">Ireland<option value="london">London<option value="midlands">Midlands<option value="n_england">Northern England<option value="scotland">Scotland<option value="s_east">South East<option value="s_west">South West<option value="wales">Wales</select></form>

Link to comment
Share on other sites

Copy this code in a HTML file and when you select the options it will redirect to the respective pages.... inorder to modify the redirected page, change the "value" attribute of the <option>.....

<html><head><title></title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"> </style><script language = "javascript" type="text/javascript">function Jump(temp){var opt_key = temp.selectedIndex;var url_val = temp.options[opt_key].value;window.open(url_val,'_top');return true;}</script></head><body><form><select name="stockists" onchange="return Jump(this);"><option value="">Select Your Region<option value="http://www.google.com">East Anglia<option value="http://www.live.com">Ireland<option value="http://images.google.com">London<option value="redirect_page.htm">Midlands<option value="redirect_page.htm">Northern England<option value="redirect_page.htm">Scotland<option value="redirect_page.htm">South East<option value="redirect_page.htm">South West<option value="redirect_page.htm">Wales</select></form></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...