Results 1 to 2 of 2

Thread: dhtml window widget return value

  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default dhtml window widget return value

    Just starting evaluating this and is looking good.

    However, I need to be able to get back a value from the page that was displayed in the diaglog when the dialog closes...is it possible to do that.

    That value could be anything integer string javascript array

    best wishes ed.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.

    Well, the onclose event handler lets you execute code when a DHTML window is closed. The variable you assigned to when calling dhtmlwindow.open() contains a DOM reference to that window, so you can use that to then access anything within the DHTML that was closed, for example:

    Code:
    var mywin=dhtmlwindow.open("sitebox", "ajax", "mypage.htm", "#1: My Web site", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")
    
    mywin.onclose=function(){ //Run custom code when window is being closed (return false to cancel action):
    alert(mywin.innerHTML) //alert contents of window
    return true
    }
    If you're using the IFRAME mode (instead of say Ajax like above), the page shown must be on your own domain, as you can't access info from a off site 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
  •