HTML
  Home arrow HTML arrow Page 5 - 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 - The swap() and quickSort() Function


    (Page 5 of 5 )

    Here these functions have to take into consideration the fact that the recordset has Input Text Controls for each visible cell. These are the new functions:


    function swap(m,n)

    {

    for (z=0; z<=6; z++)

    {

    if (z <= 5)

    {

    //form the Input Text Control ID for the parameter, m

    IDM = "EI" + m + z;

     

    //form the Input Text Control ID for the parameter, n

    IDN = "EI" + n + z;


    temp = document.getElementById(IDM).value;

    document.getElementById(IDM).value = document.getElementById(IDN).value;

    document.getElementById(IDN).value = temp;

    }

    else

    {

    temp = document.getElementById('Recordset').rows[m].cells[z].innerHTML;

    document.getElementById('Recordset').rows[m].cells[z].innerHTML = document.getElementById('Recordset').rows[n].cells[z].innerHTML;

    document.getElementById('Recordset').rows[n].cells[z].innerHTML = temp;

    }

    }

    }



    function quickSort(left,right,titleInx)

    {//the function receives a recordset, indices for the left and right rows, and the index for the title column.

    i = left;

    j = right;

     


    //form the Input Text Control ID for the parameter, left

    IDLeft = "EI" + left + titleInx;

     

     

    //form the Input Text Control ID for i

    IDI = "EI" + i + titleInx;


    //form the Input Text Control ID for j

    IDJ = "EI" + j + titleInx;


    if(document.getElementById(IDI).value > document.getElementById(IDJ).value)

    {

    swap(i, j);

    }


    do //increment i and decrement j, then swap if necessary

    {

    do

    {

    if ((i+1)<=right) //do not increment i beyond the index for the right element

    {

    ++i; IDI = "EI" + i + titleInx;

    }

    } while (document.getElementById(IDI).value < document.getElementById(IDLeft).value)

    do

    {

    if ((j-1)>=left) //do not decrement j beyond the index for the left element

    {

    --j; IDJ = "EI" + j + titleInx;

    }

    } while (document.getElementById(IDJ).value > document.getElementById(IDLeft).value)

     

    if (i<j)

    {

    swap(i, j);

    }

    } while (i < j)


    swap(j, left);

    var k = j; //the pivot.

     

    var leftLeft = left; //the index for the left element of the left sub-list, initialized

     

    if ((k-1)>=left) //we do not want a value for k that will be less than the left index

    {

    var leftRight = k - 1; //the index for the right element of the left sub-list, initialized

    }

    if ((k+1)<=right) //we do not want a value for k that will be greater than the right index

    {

    var rightLeft = k + 1; //the index for the left element of the right sub-list, initialized

    }

    var rightRight = right; //the index for the right element of the right sub-list, initialized



    //recursion for the left sub-list - only called if a left sub-list exists

    if (k != left)

    {

    quickSort(leftLeft,leftRight,titleInx);

    }

     

    //recursion for the right sub-list - only called if a right sub-list exists

    if (k != right)

    {

    quickSort(rightLeft,rightRight,titleInx);

    }

    }


    The finalize()

    The main aim of this function is to submit the data in the Transmitted table. The function has been modified for some of the reasons given above. This is the new function:


    function finalize(ID)

    {

    if (ID == "Do1")

    {

    document.getElementById('Don1').click();

    self.close(); //close the window after submit if the Done button was clicked

    }

    else

    {

    document.getElementById('Sa1').click();

    }

    }



    In this part of the series we have not considered larger text (textarea), images and video clips. I will consider video clips in a separate article. In the next parts I will consider larger texts, images and then I will also consider the program that receives the transmitted data at the server and the program sends the web page from the server.

    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.

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

    HTML ARTICLES

    - Hello HTML 5, Goodbye Gears
    - 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







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