It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

How to open link in same browser window

How to open link in same browser window

Postby ralfie on Tue Jan 12, 2010 6:39 pm

Hello, hopefully you can help me. I have the following code, which opens a new internet browser window:

<form>
<p align="center"><b></b>
<select id="setit" style="color: #0000FF" size="1" name="test">
<option value="">Please Select</option>
<option value="http://www.nu.nl">nu</option>
<option value="http://www.telegraaf.nl">telegraaf</option>
<option value="http://www.google.com">Google</option></select>
<input type="button" value="Go"
onclick="window.open(setit.options[setit.selectedIndex].value)">
</p></form>

What do I need to change so the onclick opens the link in the same internet browser window instead of opening a new one?

Many thanks, Ralfie
ralfie
 
Posts: 1
Joined: Tue Jan 12, 2010 6:38 pm

Re: How to open link in same browser window

Postby harrierdh on Wed Jan 13, 2010 3:07 pm

Change this

onclick="window.open(setit.options[setit.selectedIndex].value)"

to

onclick="location.href=setit.options[setit.selectedIndex].value)"
harrierdh
50+ Club
 
Posts: 51
Joined: Wed Dec 16, 2009 7:04 pm

How many videocard will i need to play the sims 3 (good grap

Postby Empommodo on Sat Feb 06, 2010 4:58 am

"System Administrator has set policies to prevent this installation" The virus on my computer won't let me install and run any antivirus software. I have tried to use SuperAnitSpyware, and Malwarebytes as well. I am running in safe mode, as an administrator. System restore won't work either. I need to change a setting somewhere, I just can't remember how to do it. Any help would be great. I am running XP. Thanks!

__________
Tapety
Empommodo
 
Posts: 2
Joined: Tue Feb 02, 2010 9:10 pm
Location: Belarus

Re: How to open link in same browser window

Postby Tratat on Fri Feb 12, 2010 8:30 pm

I know that in Dreamweaver
Code: Select all
target = ” _blank” = Open a link in a new browser window.
target = ” _parent” = Open a link inside a frame (see example)
target = “_self” = Open a link in the same browser window, this is a default value when you don’t assign target value.
target = ” _top” = Open a link in the same window and skip a frame set (if you use frame)

The HTML Code according to html tutorials
Code: Select all
<a href="http://www.google.com" target = "_blank">Google</a>
Tratat
 
Posts: 1
Joined: Fri Feb 12, 2010 8:23 pm


Who is online

Users browsing this forum: No registered users and 7 guests