HTML
  Home arrow HTML arrow Page 4 - How to Create a Dynamic Web Page
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 
Sun Developer Network 
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

How to Create a Dynamic Web Page
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 39
    2004-06-14

    Table of Contents:
  • How to Create a Dynamic Web Page
  • Code for Drop-down Box and Text Area
  • Making the HTML Elements Interact
  • Completed File

  • 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


    How to Create a Dynamic Web Page - Completed File


    (Page 4 of 4 )

    Your completed text file should now look a little (well, exactly) like this:

    <html>
    <head>
    <title>Dynamic Example</title>
    <script language="VBScript">
    sub people_onclick()
    if people.selectedIndex="0" then
    form1.details.value="Make a Selection"
    else
    select case people.selectedIndex
    case 1
    form1.details.value="1 Nowhere Street, Ghost Town, AB1 2CD"
    case 2
    form1.details.value="2 Unknown Lane, Gonesville, EF3 4GH"
    case 3
    form1.details.value="3 Invisible Avenue, Nothingshire, IJ5 6KL"
    case 4
    form1.details.value="4 Somewhere Road, Vancancy, MN7 8OP"
    case 5
    form1.details.value="5 lestways, Notknownsbury, QR9 0ST"
    case 6
    form1.details.value="6 Lost Court, Summerwhere, UV12 3WX"
    case 7
    form1.details.value="7 Nodnol Place. Nohampton, YZ45 6AB"
    case 8
    form1.details.value="8 Empty Square, Notthereburgh, CD7 8EF"
    case 9
    form1.details.value="9 Unbuilt Crescent, Guester, GH8 9IJ"
    case 10
    form1.details.value="10 Unfound House, Neverpool, KM27 4NO"
    end select
    end if
    end sub
    </script>
    </head>
    <body> 

    <select id=”people”>
    <option>Please select</option>
    <option>Mr Smith</option>
    <option>Mrs Bloggs</option>
    <option>Mr Doe</option>
    <option>Mrs Jones</option>
    <option>Mr Spencer</option>
    <option>Mr Field</option>
    <option>Ms Reed</option>
    <option>Mr Waters</option>
    <option>Mrs Frank</option>
    <option>Mr Green</option>
    </select>
    <form id=”form1”>
    <textarea rows="12" cols="60" id=”details”>The details will be displayed here</textarea>
    </form>
    </body>
    </html>

    If you wanted to add a little formatting to the text that is displayed in the textarea, you can add + chr(13) + in the value, for example:

    form1.details.value="1 Nowhere Street, Ghost Town, AB1 2CD" + chr(13) + “01234 546789”

    Which would then display in the textarea as:

    1 Nowhere Street, Ghost Town, AB1 2CD
    01234 546789

    chr(13) is the ASCII code for the return key on your keyboard.

    That’s all there is to it; save the file as dynamicExample.htm and open it in explorer. Have a play around to understand what the code you’ve implemented does, and congratulate yourself on making your first dynamic web page.


    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

    - Using a 3D HTML Table as a Recordset
    - Building a 3D HTML Table
    - Maximizing and Restoring HTML Images: Layer ...
    - Completing Construction of a Database Form w...
    - Maximizing and Restoring Images in a Tabular...
    - Building the Recordset for an HTML Database ...
    - Laying Out a Database Form with HTML
    - Tabular Database Form Functions with HTML
    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT