PDA

View Full Version : Error copying Div content into DHTML window



ericsodt
05-29-2008, 02:28 PM
1) Script Title:
DHTML window

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamici...ndow/index.htm

3) Describe problem:
I am working with j2ee and am running into an issue with dynamic updating divs. I have a div on my page


<div style="" id="snippetDiv">
<%@include file="/jsp/pageViewer/snippetForm.jsp" %>
</div


This snippetForm has an element that I programmatically update with some javascript.

The problem arises when I try and display the div's content within the DHTML window.


var translateSnippetDiv = dhtmlwindow.open(el.id+"Div", "div", "snippetDiv", el.value, "width=450px,height=300px,left=300px,top=100px,resize=1,scrolling=1");


The div window opens up correctly, however the information that should have been updated does not get carried over.

For instance. SnippetForm.jsp might have a form element that contains first Name. The javascript updates this forms name depending on what row in a table is clicked on. When I open the DHTML window all I see is the blank form. I know the div tag is getting updated by the javascript since I set the div tags property to 'display:block' so I can see it getting updated. Any help would be greatly appreciated

jscheuer1
05-29-2008, 03:03 PM
The link to the DD script is broken. Please fix it or post a reply with the correct link.

I can tell you that the served code is what will matter here, whether or not your include is happening. You should be able to use the browser's 'view source' to see what HTML code is being served as a result of your include.

If you do update the division after the page has loaded, perhaps it's old value may already have been saved for use in the script, or perhaps it isn't really getting updated.