zog953 Posted April 26, 2007 Share Posted April 26, 2007 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 More sharing options...
pulpfiction Posted April 26, 2007 Share Posted April 26, 2007 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 More sharing options...
zog953 Posted April 26, 2007 Author Share Posted April 26, 2007 I don't really understand what to do with that...? Link to comment Share on other sites More sharing options...
pulpfiction Posted April 26, 2007 Share Posted April 26, 2007 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 More sharing options...
zog953 Posted April 26, 2007 Author Share Posted April 26, 2007 Ahh, thank you. I have another question... If I want the link to direct to an Iframe can I just insert a... target="name_of_iframe" ? Link to comment Share on other sites More sharing options...
pulpfiction Posted April 26, 2007 Share Posted April 26, 2007 Yes... Example below.http://www.w3schools.com/html/tryit.asp?fi...rame_navigationhttp://www.w3schools.com/html/tryhtml_contents.htm Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.