Skip to main content
May 4, 2011
Question

Need help with refreshing open window in new tab

  • May 4, 2011
  • 1 reply
  • 276 views

Hello all,

First, all my other problems I've solved.  One last thing, being a newbie and trying things I've found on the net and them

not working, I can use your help one last time.  My code has a Home page that peforms a Search (most of you have

I am sure done this), and from that search submit a window opens in a new tab (browser tab) and has the results on

it.

That works fine.  What I'm having trouble with is being able to perform a new search and refreshing that open window

with the new data.  Right now I am closing that window by clicking on the tab and then performing the search.

While it works, it's not user friendly.

So, I've tried the usual  mywindow=window.open("url.cfm"); and then trying to grab that handle to refresh, but to

no avail.  Has anyone done this?

Thanks!

    This topic has been closed for replies.

    1 reply

    Participant
    May 6, 2011

    Here's an example of how you could do it.

    <script>

    function submitAndFocusTarget(form) {

      var win = window.open("", form.target);

      form.submit();

      win.focus();

    }

    </script>

    <form action="index.cfm" target="mysearchwin" method="get" onsubmit="submitAndFocusTarget(this); return false;">

      <input type="text" name="search" value="" />

      <input type="submit" value="search" />

    </form>