Passing data via getelementby id to child box

Page: 1

Author Post
Member
Registered: Nov 2008
Posts: 28
Sir:

I was have a difficult time with the following:

asp page ---> floatbox (asp form page) ---> floatbox child (html)

I wanted to display the data on the intermediate form in the floatbox child as a preview of the data submitted (for sending email memo's).

I was able to solve the problem with the information provided under the topic "child box id (smarten, 11-24-2008" and it worked great.

But I was testing/developing using FF as my browser! This is being developed as an feature on our in-house (i.e., private) web site and one of my colleagues uses IE (I don't know what version right now). In his case, all the floatbox windows open properly but there is not data displayed in the floatbox child (html) window.

Are there any known issues passing data around with the getelementbyid function that may be causing this?

Thank you in advance for your assistance. Floatbox is great and your technical support appears to be timely and superior to other competitors.

Fred
Administrator
Registered: Aug 2008
Posts: 3382
Really difficult to say what might be happening without being able to see it and look into the page code.
Is the form being loaded from an inline hidden div by any chance? If so, try loading it as an iframe or from an ajax call instead. The current (very soon to be old) version of floatbox copies hidden div content into the box and if there's ids on elements in that content you end up with duplicate ids. One browser may be talking to one of duplicates and the other browser talking to the other one.

The new version moves that content, rather than copies it, but forms are happier coming in as ajax or iframes for other reasons as well.
Member
Registered: Nov 2008
Posts: 28
Sir:

Thank you for the prompt reply.

I don't see the option of attaching code (i.e., asp files) so I will look into setting up a test site to illustrate the problem.

Unfortunately, I can not send you directly to the active web site since it is (supposed) to be only available to our employees. I am sorry.

But I will try look closer at the code and if I am still stumped I will establish a test site.

Thank you again for your prompt response.

Fred
Member
Registered: Nov 2008
Posts: 28
Sir:

It looks ugly but it mimics the required behavior.

Go here (please): http://www.fruitorder.com/test1/test1.asp
Click on the text link to invoke the first floadbox popup
Click on the preview button to invoke the 2nd floadtbox (child) popup

In FF everything appear correctly in the 2nd (child/preview) pop-up.

In IE NONE of the data appears in the 2nd (child/preview) pop-up.

Thank you again in advance if you can shed some light on what I am doing wrong.

I love floatbox and try to use it in situations that would benefit from it (not just be a gratuititous use of it). I think this preview is a good use of floatbox ... if I can resolve this issue with IE.

Fred
Administrator
Registered: Aug 2008
Posts: 3382
IE8 is having a problem on memo3.asp with the FillInPage function. The problem occurs immediately after this code.
var node = parent.fb.fbParent.fbContent;
var idoc = node.contentDocument || node.contentWindow; // iframe's document, or maybe its window
idoc = idoc.document || idoc; // now it's the doc for sure

Could you please try out something to help determine what the complaint is about. After those lines, can you insert alert(idoc); and tell me what FF says and what IE says.

You could also try changing those lines to:
var node = parent.fb.fbContent;
var idoc = node.contentDocument || (node.contentWindow && node.contentWindow.document);


It should give the same result, but it's worth a shot. (Notice I dropped fbParent out of the first line. It's not needed, you're already talking to the parent, but it was harmless as fbParent just points to itself when it's the first floatbox.)
Member
Registered: Nov 2008
Posts: 28
Sir:

When I added the alert, in both FF and IE the dialog box displayed "[object HTMLDocument]". In FF the data was subsequently displayed but NOT in IE.

I got the very same results when I changed the "var node/var idoc" code, as you suspected.

Fred
Administrator
Registered: Aug 2008
Posts: 3382
So idoc is successfully set as the document object in both browsers, and yet IE fails with "object doesn't support this property or method" when calling getElementById from that document object. Very mysterious indeed.

I'll keep looking.

If you wanted to give up in frustration, you could take an alternate approach of passing the form values along to memo3.asp as querystring values on the url (...memo3.asp?name1=value1&name2=value2&...). And then memo3.asp would parse them out from there. (Probably easiest to do that parsing server-side rather than client-side javascript, but both could work.)

Page: 1