HYPERLINK FOCUS

S

Scott

The below html code successfully opened a popup window (defined size, no
address bar), however, when it is clicked over and over on the main page,
multiple windows end up open. Is there a way to insert a code that would
simply bring the open window into focus when the link is clicked. This is
for a calculator that a user would want to keep open in the background.
However, feedback suggests that instead of clicking on the open window, most
users click the original link.


<tr>
<td align="center" height="75%">
Click below for link<br>
<input type="button" value="View calculator" class="Calc_InputButton"
onclick="window.open('WEB PAGE', '', 'height=600,width=800')">

</td>
</tr>
 
R

Ronx

Name the window
onclick="window.open('WEB PAGE', 'windowName', 'height=600,width=800')

This will always open the same window.

In the page that opens add code to bring the window into focus:

<body onload="window.focus()">

If you have other onload functions, then use

<body onload="myfunction();window.focus()">

Note that IE7 will add the address bar.
 

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

Top