PDA

View Full Version : Help Opening new window!


QLink
11-02-2003, 04:13 AM
Hi,

I have two drop-menus, when i try opening a link, it opens on the same page, can you please help me change this so that the link opens on a new window (_blank)..

The javascript code is:

<script type="text/javascript" language="javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'" );
if (restore) selObj.selectedIndex=0;
}
</script>

agent002
11-02-2003, 09:37 AM
That seems like only a part of the code, can you give the full code please?

QLink
11-02-2003, 09:52 AM
I attached the file of full code as notepad because it is too long to post..

Thanks again for your help..

agent002
11-02-2003, 10:10 AM
Change
onChange="MM_jumpMenu('parent',this,0)"

to
onChange="MM_jumpMenu('_blank',this,0)"

And by the way, the JavaScript code should be between the <head> and </head> tags, not between </body> and </html>.

QLink
11-02-2003, 10:28 AM
I did all that but i got a runtime error
line: 12
Error: '_blank' undefined

:( :( :(

piglet
11-03-2003, 07:49 AM
Hi,

If you change:

onChange="MM_jumpMenu('parent',this,0)"

to

onchange="window.open(this.options[this.selectedIndex].value,'_blank');"

then it should do what you want. You could drop the MM_ function then

QLink
11-03-2003, 09:26 AM
I will try that..

It worked fine.. THANKS PIGLET :D :D :rocker: