i'm attempting create dropdown menu form. looks this:
<select onchange="location.href=(form.menu1.options[form.menu1.selectedindex].value)" id="setit" size="1" name="menu1"> <option value="0">select one</option> <option value="http://www.products.com">products</option> <option value="http://www.literature.com">literature</option> <option value="http://www.technical.com">technical <option value="http://www.registration.com">product registration</option> </select> </form>
in "onchange" have code dictating when option selected trigger designated hyperlink , new page load. can't seem work clicking option open new tab. how can working?
i investigated bit solution , none of ones proposed seemed work, @ least found. when insert of various proposed solutions form (either using target="_blank" or of javascript equivalents pop-up windows , such) none of them make hyperlink open in new tab nor new window, loads page in same window. assume due fact hyperlink not written in form "href" , instead written "value". can absolve issue?
window.location
refers location of current document, that's not want. try calling window.open()
instead:
<select onchange="window.open(form.menu1.options[form.menu1.selectedindex].value)">
Comments
Post a Comment