HTML
  Home arrow HTML arrow Page 2 - Opening Web Page Dialog Boxes with Other D...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Opening Web Page Dialog Boxes with Other Dialog Boxes
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-01-12

    Table of Contents:
  • Opening Web Page Dialog Boxes with Other Dialog Boxes
  • Content
  • Child HTML
  • Adding a Row in a Child Table

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Opening Web Page Dialog Boxes with Other Dialog Boxes - Content


    (Page 2 of 4 )

    Passing Values

    If you have worked with other dialog boxes such as in win32 (or in studios) you might have come across the idea that when you open a dialog box, you can pass values to it as you are opening it. Here the situation is different. When you open a dialog box, it is empty. You do not only have to pass values, you pass the content of the window, including script (code) and values for script variables. We have seen this.

    Changing and Adding Content in Another Box

    Next we shall talk about changing the values of JavaScript variables in another dialog box, changing the values of HTML elements in another box, and changing table cell contents in another box. These are the ways you can change content. To add content you can add a table row in a table that is in the other dialog box. We shall also talk about this.

    In the methods I will show you, when you change or add content in another window, the effects take place immediately.

    We shall start by seeing how you can do this with the immediate child and the immediate parent.

    Changing and Adding Content to the Immediate Child Box

    Recall that when creating (opening) a box, a reference is returned. We always assigned the reference to an identifier. In

    myWindow = window.open();

    myWindow is the reference returned. This reference represents the new window, and it is needed to access any component in the window.

    Setting and Reading the Child JavaScript Variable

    Assume that in the immediate child window you have the following JavaScript Code:


    <script type="text/javascript">

    var firstName;

    //the rest of the JavaScript code …

    </script>


    In the JavaScript Code of the parent window, you can set this variable, giving the value “John” as follows:

    myWindow.firstName = "John";

    So, in the JavaScript Code in the parent, you use the reference to the child window; this is followed by the variable in the child window. The value is assigned with the equal sign.

    You read the value of the variable from the parent window in a similar way. The following code in the JavaScript of the parent window will read the value of the variable in the child window and assign it to the variable, name, in the parent window.

    var name = myWindow.firstName;


    Again, we need the reference to the child window, and the variable in the child window, to achieve this.

    More HTML Articles
    More By Chrysanthus Forcha


     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek