Web Design and Web Development Forum

  1. #1
    cancer10's Avatar
    Join Date
    Jun 2005
    Location
    India
    Age
    29
    Posts
    498
    Rep Power
    7
  2. cancer10 is on a distinguished road
  3. Question Javascript - Refresh Parent Window?

    Hi

    I have an HTML page (index.html) and a link in it. Clicking on that link opens a javascript Popup (popup.html). There is a small form on the popup window. Now when someone submits the form in that popup.html page, the index.html should refresh automatically.

    Anyone knows how to do this?


    Please help me.


    Thanx
    Reply With Quote Reply With Quote
  4. #2
    Join Date
    Feb 2005
    Location
    Moodles, UK
    Posts
    2,258
    Rep Power
    0
  5. Calamitie will become famous soon enough
  6. Re: Javascript - Refresh Parent Window?

    <script type="text/javascript">
    opener.location.reload;
    // window.close(); if you want the window to close too
    </script>
    Reply With Quote Reply With Quote
  7. #3
    cancer10's Avatar
    Join Date
    Jun 2005
    Location
    India
    Age
    29
    Posts
    498
    Rep Power
    7
  8. cancer10 is on a distinguished road
  9. Re: Javascript - Refresh Parent Window?

    Question:

    Can this be used after the form is submitted? Or this needs to a click event to operate?
    Reply With Quote Reply With Quote
  10. #4
    Join Date
    Dec 2007
    Location
    The Draco Supercluster
    Age
    18
    Posts
    395
    Rep Power
    0
  11. Aepos is on a distinguished road
  12. Re: Javascript - Refresh Parent Window?

    Don't just put the script out there in the open, or the parent page will refresh whether the form is submitted or not. If I were you, I'd just add a submit event. Here is the script, if you are submitting the data back to the parent page:

    [code]
    <html>
    <body>
    <form action="index.html" method="post" onSubmit="opener.location.reload;">
    ...
    <input type="submit" value="Submit" name="submit">
    <body>
    </html>
    · · ÷¦÷ · · · ÷¦÷ · · · ÷¦÷ · · · ÷¦÷ · · · ÷¦÷ · · · ÷¦÷ · ·
    A · S · C · I · I · · A · D · D · I · C · T · I · O · N
    · · ÷¦÷ · · · ÷¦÷ · · · ÷¦÷ · · · ÷¦÷ · · · ÷¦÷ · · · ÷¦÷ · ·
    Reply With Quote Reply With Quote
  13. #5
    Join Date
    Sep 2005
    Location
    UK
    Age
    27
    Posts
    807
    Rep Power
    0
  14. bfsog is on a distinguished road
  15. Re: Javascript - Refresh Parent Window?

    JavaScript event handlers should be lowercase.
    Reply With Quote Reply With Quote

Similar Threads

  1. C++ help (cox32.obj, main error etc) plz
    By Adrian in forum C and C++ Programming
    Replies: 6
    Last Post: 04-16-2008, 06:02 AM
  2. how to pass variable between windows
    By AngeloBlu in forum JavaScript Coding
    Replies: 9
    Last Post: 04-20-2006, 03:16 AM
  3. Javascript
    By YoungCoder in forum JavaScript Coding
    Replies: 5
    Last Post: 09-25-2004, 04:16 AM
  4. How to Start Javascript
    By Vio-Bear in forum Javascript Articles
    Replies: 0
    Last Post: 09-05-2004, 09:14 AM
  5. Javascript part 1
    By hayabusa in forum Javascript Articles
    Replies: 0
    Last Post: 09-05-2004, 09:01 AM