Home arrow HTML arrow Page 3 - Opening Web Page Dialog Boxes with Other Dialog Boxes
HTML

Opening Web Page Dialog Boxes with Other Dialog Boxes


It is possible for one dialog box to open another dialog box. In this way, you can have a chain of boxes where the box that opens is the Parent box, and the one opened is the Child box. The main window is the first parent. In this article, the third one in a five-part series, you will learn how to do this and more.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
January 12, 2009
TABLE OF CONTENTS:
  1. · Opening Web Page Dialog Boxes with Other Dialog Boxes
  2. · Content
  3. · Child HTML
  4. · Adding a Row in a Child Table

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Opening Web Page Dialog Boxes with Other Dialog Boxes - Child HTML
(Page 3 of 4 )

Setting and Reading Child HTML Element Values

In the JavaScript of the parent window, the following statement would access the value of an element in the child window.


myWindow.document.getElementById(ID).value


Assume that you have the following element in the child window:


<input type=”text” id=”I1”>


The following statement in the parent script would set the value of the Input Text control to “Peter”.


myWindow.document.getElementById('I1').value = "Peter";


And the following code in the parent script would read the value of the Input Text element from the child window into the variable, name, in the parent window:


var name = myWindow.document.getElementById('I1').value;


Setting and Reading Child HTML TD Content

The method is similar to the one explained above, but instead of the property, value, you have the property, innerHTML.

Assume that you have the following element in the child window:


<table>

<tr>

<td id="TD1">

The cell content

</td>

</tr>

</table>


The following statement in the parent script would set the content of the table cell element to “New Cell Content.”


myWindow.document.getElementById('TD1').innerHTML = "New Cell Content"


And the following code in the parent script would read the content of the table cell element from the child window into a variable (content) in the parent window:

var content = myWindow.document.getElementById ('TD1').innerHTML;


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials