Open a window without focus

N

noon

Can't get this to work, tried every bit of code I could think of and
every snippet I could find out there.

I have a form with the js code in the onsubmit action. I know, I
shoved it all in there instead of making a function. I don't have
access to include a .js file or put it in the head, work with me.

How can I get this to work?

<form method="get" action="#" onsubmit="var newWin =
window.open(\'http://google.com/search?q=\'+this.imdbSearch.value+\'\',
\'IMDBWindow\');window.setTimeout(\'self.focus();\',500);if(!
newWin.opener) newWin.opener=this;return false;">
<input type="text" name="imdbSearch" size="40">
<input type="submit" value="Search">
</form>
 
T

The Natural Philosopher

noon said:
Can't get this to work, tried every bit of code I could think of and
every snippet I could find out there.

I have a form with the js code in the onsubmit action. I know, I
shoved it all in there instead of making a function. I don't have
access to include a .js file or put it in the head, work with me.

How can I get this to work?

<form method="get" action="#" onsubmit="var newWin =
window.open(\'http://google.com/search?q=\'+this.imdbSearch.value+\'\',
\'IMDBWindow\');window.setTimeout(\'self.focus();\',500);if(!
newWin.opener) newWin.opener=this;return false;">
<input type="text" name="imdbSearch" size="40">
<input type="submit" value="Search">
</form>
I had the opposite problem. How to move focus relaibly TO the open window..

i used
newwin=window.open(....)
newwin.focus();

IIRC. Try using the above form and newwin.blur()

Or move focus to the parent.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top