This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic DIV tag

 
Sathish Ramadas
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
the requirement is ...open a popup window from a parent window and select the details in the child window and submit. the selected details should be shown in the parent window. how to display the child window details in the parent window dynamically.
I thought of using DIV tag. but how refresh the div in the parent window when i submit the details in the child window.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you fill in the information in the parent page?
 
Sathish Ramadas
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
parent page will have some static field area apart from that one dynamic area where the data from the popup window will be pasted into it.The dyanmic area is full of text and some check boxes.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can access the parent div from the child window with

window.opener.document.getElementById("theDivId").innerHTML

you can change what ever you want in that div.

Not sure what you are trying to do exactly.

Eric
 
Sathish Ramadas
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose initially one row is displayed in the parent window. Then i open the child window and do the operation. Now i need the old row plus the new updated row in the parent DIV. IS this possible?
 
Sathish Ramadas
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i use window.opener.document.getElementById("DivExample").innerHTML=
then i need to construct the whole html div code and assign with this right? is this right way or any other way to do this.

because the DIv tag part contains kind of contact details ( for eg: client address, phone etc in address format)
 
Sathish Ramadas
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am creating DIv tag in the parent window. Then open a child window (popup) and do the submit operation in it. update the parent DIV tag using opener and the parent window also update propely. now i could't access those div tag elements from the parent window. how do i access those attribute.

becos once the data come from child window to parent then i am submitting the parent window. here servlet could't get the div attribute values.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure how your servlet is getting the div information since I am assuminbg you are doing a postwhichonly takes information in a form. Once you submit the parent or the child window they loose conection with each other. They no longer can communicate eith each other.

I would personally say do not rely on JavaScript to build the information. If you are usig Servlets rely on that. JavaScript can be disabled, server side can not.

Eric
 
Sathish Ramadas
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have generated the HTML code in the child window. the Html code contains check boxes and hyperlink. Once i submit the child window the HTML code is pasted in the parent window (DIV tag). but how can acces those checkboxes values and hyper link method.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
document.formname.elementname

or

document.getElementByID('name');

or

window.opener.docu....

Is that what you are asking, how to access it with JavaScript?
 
Sathish Ramadas
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
once innerhtml is constructed in the child window then it will be displayed in the parent window.
then if you try to acces the div tag elements for eg.one hyperlink is displaying the div tag area (parent window) but when i click that it is not calling the method what i defined while constructing the innerHtml code.

also i right click the parent window and open view souce but i could't see any details of the DIV tag.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you vew the source you are not goint to see it since it is in the browser's memeroy and not in the file. When you view the source you just see the file that was downloaded from the server.
 
Sathish Ramadas
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric ....Thank you so much for your kind information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic