views:

17

answers:

3

Hello All,

How can I ensure that this does NOT open in a new window??

onclick="ob=this.form.table;window.open(ob.options[ob.selectedIndex].value)"/>
A: 

Do you want it to open in the same window?

if so use window.location

gmcalab
+1  A: 

You should replace it with:

onclick="ob=this.form.table;document.location=ob.options[ob.selectedIndex].value;"/>

Window.open() opens a new window; document.location changes the page in the current window.

Prutswonder
+1  A: 

if you want it open in a same window you need to write

onclick="ob=this.form.table;window.location.href=(ob.options[ob.selectedIndex].value)"/>
Hojo
hum this didn't work must be a problem with my javascript coding...
Charles Marsh