Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a link in pull down menu open to a new browser? 1

Status
Not open for further replies.

naflod

Technical User
Oct 16, 2009
2
US
Hello,
I'm creating a library presence on a government web site (not voluntarily) and am using a javascript for a pull down menu. They've provided me with the html to insert on my page and all I have to do is replace their URLs with mine.

I do not know where they (IT dept.) got the code but when I ask them how to do something they tell me they don't know Java and send me on my happy little way. What I want to do is have the links open in a new brower, like with target="_blank", but obviously it doesn't work. Can anyone help, please?

Abbreviated version of code:

<select id="lb_1" name="url" onchange="window.location=url.value;" class="bodytxt">
                <option value=" selected="selected">Access Catalog/Find Library Material</option>
</select>

Website:


Thanks in advance
George Seaman
MCLS
 
Hi

Use [tt]window.open()[/tt] :
Code:
[b]<select[/b] [maroon]id[/maroon][teal]=[/teal][green][i]"lb_1"[/i][/green] [maroon]name[/maroon][teal]=[/teal][green][i]"url"[/i][/green] [maroon]onchange[/maroon][teal]=[/teal][green][i]"window.[highlight]open([/highlight]url.value[highlight],'')[/highlight];"[/i][/green] [maroon]class[/maroon][teal]=[/teal][green][i]"bodytxt"[/i][/green][b]>[/b]
[b]<option[/b] [maroon]value[/maroon][teal]=[/teal][green][i]"[URL unfurl="true"]http://www.lib.martin.fl.us"[/URL][/i][/green] [maroon]selected[/maroon][teal]=[/teal][green][i]"selected"[/i][/green][b]>[/b]Access Catalog/Find Library Material[b]</option>[/b]
[b]</select>[/b]

Feherke.
 
WOW!!!

In all my years of asking for help outside of my area of expertise, I've NEVER received such a perfect response so QUICKLY!!!!!

Thank you Mr. Feherke, and thank you Tek-Tips!
I'm here to stay!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top