HTML
  Home arrow HTML arrow Page 4 - Building Single Row Database Forms with HT...
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

Building Single Row Database Forms with HTML
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2008-07-16

    Table of Contents:
  • Building Single Row Database Forms with HTML
  • Sending Changes to Server Database
  • The Form Code
  • The Nature of the Recordset
  • The disableButtons(selectedButtons) Function

  • 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


    Building Single Row Database Forms with HTML - The Nature of the Recordset


    (Page 4 of 5 )

    The recordset is a TABLE element with a style property of display:none. This table is at the bottom of the web page just before the end tag (</body>) of the BODY element. The field value of a row is the content of the TD element. It is good to design a web page so that elements are rendered (displayed) as they arrive at the browser. In our case, we need to see the form first before we see the values of the form fields or do anything with the recordset. That is why the recordset table is at the bottom of the web page.

    The word “field” in this context can mean two things. It can mean a cell in a row of the recordset or it can mean the rectangle of the HTML INPUT element that receives the text you type.

    There are seven fields (TD elements) in each row of the recordset. The first field in the row corresponds to the top-most Input element of the form. The next field corresponds to the second top-most Input element of the form, and so on until the sixth corresponding field. The last field of the row is not displayed on the form. This field is used to indicate whether its particular row in the recordset has been edited. Any row (record) that has not been edited has a value of –1 for this field. When a row of the recordset is edited, its value for this field becomes the row number of its copied row in the Transmitted Table. We shall see the reasons for this later.

    Common Functions

    All the code (JavaScript) that manipulates the form is in the web page. There are some functions that are used by other functions. These are common functions. I start by explaining these first.

    Activating and Deactivating the INPUT Controls

    When the form is first displayed, the text input fields are read-only. So you cannot change the content by simply clicking it with the mouse pointer and typing.


    The makeReadOnlyInputControls() Function

    This function makes all the text Input controls read-only. The code is:


    function makeReadOnlyInputControls()

    {

    for (j=0;j<6;j++) //there are 6 input text controls

    {

    //form the control ID

    ID = "EI" + j;

    document.getElementById(ID).readOnly=true;

    }

    }

    There are six text Input elements with IDs: EI0, EI1, EI2, EI3, EI4, EI5, and EI6. The above function gets these IDs for the six Input elements with the following statement:


    ID = "EI" + j;


    Many other functions use this technique, so I will not explain it again in order to save time. Every other thing in the function is self-explanatory.

    The makeWriteInputControls() Function

    Before you can type anything into the Input elements, this function has to be called so that the text controls can be made to receive text. The code is:


    function makeWriteInputControls()

    {

    for (j=0;j<6;j++) //there are 6 input text controls

    {

    //form the control ID

    ID = "EI" + j;

    document.getElementById(ID).readOnly=false;

    }

    }


    More HTML Articles
    More By Chrysanthus Forcha


       · The story continues.Chrys
     

    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 6 hosted by Hostway
    Stay green...Green IT