HTML
  Home arrow HTML arrow Page 4 - Setting the Features of Web Page Dialog Bo...
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

Setting the Features of Web Page Dialog Boxes
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-01-05

    Table of Contents:
  • Setting the Features of Web Page Dialog Boxes
  • Size and Position
  • Sending Content to the Dialog Box
  • Giving it Body Elements

  • 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


    Setting the Features of Web Page Dialog Boxes - Giving it Body Elements


    (Page 4 of 4 )

    Here we shall give the dialog box two text input elements and a button. The method is simple. Simply add the corresponding tags to the string within the BODY tags. Including these in the above code, we have:


    <script type="text/javascript">

    function openWindow()

    {

    boxStr = "<html>"

    + "<head>"

    + "<style type="text/css">"

    + "body {background-color:silver}"

    + "</style>"

    + "</head>"

    + "<body>"

    + "First Input: &nbsp&nbsp&nbsp&nbsp&nbsp<input type="text"> <br />"

    + "Second Input: <input type="text"> <br /> <br />"

    + "<button type="button">Done</button>"

    + "</body>"

    +"</html>";

     

    myWindow = window.open("","","menubar=no,toolbar=no,width=400,height=400","");

    myWindow.document.write(boxStr);

    }

    </script>


    The “&nbsp” and the “<br />” elements are for formatting purposes only. This enables the controls to be better placed.

    We are at the end of the dialog box basics. The last thing we need to talk about is the onunload event of the HTML BODY element for the dialog box.

    Closing the Dialog Box

    The “Done” button for any dialog box is clicked when you have finished using the box. Clicking this button should trigger the onunload event of the dialog box. Closing the dialog box by clicking the Close button should also trigger the onunload event.

    When the onunload event is triggered, you can carry out any final task for the box. At this point, information may have to be sent to the database at the server, or to the main window, or some other dialog box that is still open. You write a function in JavaScript that carries out the final task. Your web page may look like this:


    <html>


    <head>

    <title>New Page 1</title>

    </head>

    <script type="text/javascript">

    function finalize()

    {

    //statement to finalize

    // ---

    //close the window

    }

    </script>


    <body onunload="finalize()">


    <button type="button" onclick = "finalize()">Done</button>


    </body>


    </html>


    Do not forget to include a Close statement in the finalize() function. This is because you want the window to close when you click the Done button. We shall talk about the close statement later in the series.

    We continue in the next part of the series.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    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 3 Hosted by Hostway
    Stay green...Green IT