July 15, 201016 yr Hey guys, I have a page on wordpress and I am trying to get a list that comes up with a number of different options. When you click on an option, I am wanting that list-item to be selected and the hyperlink attached to take the user to the desired page. The current page is: http://lmhc.co.uk/squad-page/ The code in hdeaer.php: <script LANGUAGE="javascript"> function OnChange(dropdown) { var myindex = dropdown.selectedIndex var SelValue = dropdown.options[myindex].value var baseURL = <Some value based on SelValue> top.location.href = baseURL; return true; } </SCRIPT> The code in the template page: <select name=select1 onchange='OnChange(this.form.select1);'> <option value="http://www.google.com">google</option> <option value="http://www.apple.com">apple</option> <option value="http://www.yahoo.com">yahoo</option> </select> I'm not very savvy when it comes to JavaScript so this may well be (and probably is) completely wrong. I have tried to piece this all together from tutorials as I have never done this before ...it can't be this hard! Many thanks for any help, Ali
Create an account or sign in to comment