Multiple selection of dropdown menu and direct to a link -
i looking javascript or in jquery custom dropdown menu
<form name="menu"> <select onchange="location = this.options[this.selectedindex].value;"> <option value="" selected="selected">courses</option> <option value="http://www.google.com">course1</option> <option value="http://www.youtube.com">course2</option> <option value="http://www.yahoo.com">course3</option> </select> <select onchange="location = this.options[this.selectedindex].value;"> <option value="" selected="selected">location</option> <option value="http://www.google.com">location1</option> <option value="http://www.youtube.com">location2</option> <option value="http://www.yahoo.com">location3</option> </select> </form> http://jsfiddle.net/kundansingh/d4fev/2/
in if select of course , location should redirect paticular url, each course, different locations there , url
follow steps:
- just pass value(url) javascript function argument.
- grab value in javascript function.
- redirect url (might use window.location.assign(url) function)`
Comments
Post a Comment