Loading ...
Sorry, an error occurred while loading the content.

Re: [OLmws] Populate Popup with data from hidden fields

Expand Messages
  • Foteos Macrides
    John, You should change that to: onclick= OLgetAJAX( options.html , displayOptions); return false; and in your displayOptions make your overlib call followed
    Message 1 of 6 , Apr 1, 2008
    • 0 Attachment
      John,
       
      You should change that to:
       
      onclick="OLgetAJAX('options.html', displayOptions); return false;"
       
      and in your displayOptions make your overlib call followed by the OptFetch call:
       
      function OptFetch(){
       overlib(OLresponseAJAX, . . . );
       OptFetch();
       return false;
      }
       
      The OLgetAJAX call sets up an asynchronous http request via the XMLHttpRequest object (or its ActiveX predecessor in IE6 and older).  Whenever the http response arrives, its responseText in loaded into the OLresponseAJAX global and the OptFetch function is called.  The initial overlib call in that function then loads the global into the DHTML popup, so that it becomes part of the document, that's when you want to make the OptFetch call to copy your hidden input's data into the popup content.
       
      With what you had, when you stepped with Firebug you caused a delay such that the asynchronous request was completed and the DHTML popup was loaded before the OptFetch call was made, and so it worked, but otherwise the OptFetch call occurred too soon and you instead got an error with the associated message indicating that an element with id="optDup" doesn't exist (yet, because the overlib call had not yet been made).
       
      Fote
      --
       
      ----- Original Message -----
      From: jp.waters
      Sent: Tuesday, April 01, 2008 1:40 AM
      Subject: Re: [OLmws] Populate Popup with data from hidden fields

      Ok  I now call it with
       OnClick="return OLgetAJAX('options.html', displayOptions),
        OptFetch(); return false; " 

      This triggers the function to copy the hidden fields. Now I get a error
       document.getElementById("optDup") has no properties

      this is the first line of OptFetch
       document.getElementById("optDup").checked =  
        document.getElementById("snfDup").checked;
      If I set a breakpoint using firebug and single step it, it all Ok

      What could be going wrong?
        
      John
    Your message has been successfully submitted and would be delivered to recipients shortly.