HTML
  Home arrow HTML arrow Tabular Database Form Functions with HTML
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

Tabular Database Form Functions with HTML
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2008-09-10

    Table of Contents:
  • Tabular Database Form Functions with HTML
  • The editRow() Function
  • The includeInTransmittedTable()
  • The deleteRow() Function
  • The swap() and quickSort() 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


    Tabular Database Form Functions with HTML


    (Page 1 of 5 )

    Welcome to the ninth part of a thirteen-part series on HTML database forms. In the previous part we began our discussion of Tabular forms, having dealt with Single-Row forms up until that point. In this part we continue our discussion of what functions to use with Tabular forms and how they are different from their Single-Row counterparts.

    The selectRow() Function

    Before you can edit or delete, a row has to be selected. You select a row by simply clicking on it. When you do that the click event calls the selectRow() function. This function has as an argument the ID of the row clicked. With this ID the SelectRow() function changes the background color of the row to blue. Now you will see only the outline of the row because the Input Text Controls are covering much of its background.

    From the row ID, the selectRow() function obtains the row position (minus 1) and makes that the index. Recall that our index variable indicates the row position that is active. This is the selectRow() function with an associated variable:


    var oldRowID = ""; //when a new row is selected, use this to deselect the old row


    //function to indicate that row is selected

    function selectRow(ID)

    {

    document.getElementById(ID).style.backgroundColor = "blue";

    if ((oldRowID != "")&&(oldRowID != ID))

    document.getElementById(oldRowID).style.backgroundColor = "transparent";

    index = parseInt(ID.charAt(2));

    oldRowID = ID;

    }



    The effectAddEdit() function

    The user clicks the conspicuous button when he has just finished typing in the ADD or EDIT mode. When he clicks the button, this function is called. The function checks to see if you were in the add mode. If you were, it adds the record to the Transmitted table. It then resets the addMode variable and makes the new row read-only, by calling the "makeReadOnlyInputControls()" function, which now takes the index as its argument.

    The function also checks whether you were in the edit mode. If you were, it behaves in a manner similar to the way it did for the add mode. 

    The last thing the function does is enable all the buttons and then remove the conspicuous button (until it is needed again). This is the function:



    function effectAddEdit()

    {

    //Add to transmitted table

    if (addMode == true)

    {

    //include the added row in the transmitted table

    includeInTransmittedTable('ADDED');

    //after including, you must go out of the addMode, so reset the addMode variable

    addMode = false;

    makeReadOnlyInputControls(index);

    }


    //edit any row of the recordset that might have been edited at the form

    if (editMode == true)

    {

    //include the added row in the transmitted table

    includeInTransmittedTable('EDITED');

    //after adding, you must go out of the editMode, so reset the editMode variable

    editMode = false;

    makeReadOnlyInputControls(index);

    }

     

    enableButtons('A1','E1','D1','C1','So1','S1','Do1');

    //remove the button that sent the added row to the transmitted table

    document.getElementById('TDAE1').style.display = "none";

    }



    More HTML Articles
    More By Chrysanthus Forcha


       · It is inspiring. Just one word: Continue.Chrys
     

    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 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek