SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onclick prompt for delete, then refresh main page.

    hi everyone.

    i'm having a slight problem and i'm hoping someone can help me.

    i have a page with an iframe. once an item is deleted from the iframe, i need the main page refreshed.

    its seems like i can only delete or refresh, but not do both actions together. let me further explain. The confirmation popup message does appear and the refresh is done, but the file is not deleted. if i just use confirmation() on the onclick, it deletes the selected file, but if i use (confirmation(),refreshPage()) the file isn't deleted if they click yes. but the page is refreshed.

    can anyone suggest anything i could try? thanks.

    Code:
    <script type="text/javascript">
    function reloadPage()
      {
      parent.window.location.reload()
      }
    </script>
    
    <script type="text/javascript">
    function confirmation()
    {
      if (confirm("Are you sure you want to delete the custom search?")==true)
        return true;
      else
        return false;
    }
    </script>
    
    <a href="<?php echo $_SERVER['PHP_SELF']; ?>?action=del&amp;ID=<?php echo $f['ID']; ?>" onclick="(confirmation(),reloadPage())">Delete</a>]

  2. #2
    SitePoint Member
    Join Date
    Nov 2009
    Location
    North Carolina
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    II have not tested it but would something like this work?

    Code:
    <a href="http://www.yahoo.com" onclick="(if (confirmation() parent.window.location.reload();">Delete</a>
    If I have been of help to you please consider making a
    donation for my time via PayPal here.
    Get a GREAT domain for under $20 each day via my
    STEAL of the DAY page.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •