how to close a particular pop up and display the message in another page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Normal Daniel
    New Member
    • Oct 2011
    • 1

    how to close a particular pop up and display the message in another page

    i have a link which pops out a new window and in that new window there is a forms which is used to update a record draw out from database depending on the the record id appended to the url like
    edit-record.html?r-id=1;

    now on the form where i will update the record and send the submit I made it in a way that once it is clicked on the pop up windows closes itself,

    eg
    Code:
    <form action="edit.class.php" method="post" name="editform">
    <textarea>$row[record]</textarea>
    <input type="submit" onclick="self.close();" />
    </form>
    now after the submit button is clicked it closes the pop up window and the update query is done behind the scenes in edit.class.php.

    what i want to do is this, after the query is done in edit.class.php
    Code:
    if($sql){
    //result text shows in record.hmtl automatically and disappears
    }
    else if(!sql){
    //result text also shows in record.html automatically and disappears
    }
    then I want the result of the query to be shown in records.html using something like Ajax (i don't know exactly) but once the text appears it also disappears automatically itself after let's say 5 mins
    I don't know Ajax and all online solutions make me confused,

    all i want is a tip of how to do it using some codes.
    I will be very grateful
    Last edited by acoder; Oct 30 '11, 02:36 PM. Reason: Added [code] tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Is records.html the parent page, i.e. the one which contains the link to open the popup window?

    If it is, you can use window.opener to refer to the parent window. You can display an element, e.g. div, with the message and use setTimeout to close after 5 seconds.

    To display/hide, set the display property to "block"/"none" respectively.

    That should get you started. If you get stuck, post your code.

    Comment

    Working...