Home arrow HTML arrow Page 4 - Tabular Database Form Functions with HTML
HTML

Tabular Database Form Functions with HTML


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.

Author Info:
By: Chrysanthus Forcha
Rating: 4 stars4 stars4 stars4 stars4 stars / 3
September 10, 2008
TABLE OF CONTENTS:
  1. · Tabular Database Form Functions with HTML
  2. · The editRow() Function
  3. · The includeInTransmittedTable()
  4. · The deleteRow() Function
  5. · The swap() and quickSort() Function

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Tabular Database Form Functions with HTML - The deleteRow() Function
(Page 4 of 5 )

This function first of all checks to see if a row has been selected, just as the editRow() Function did. It also has to take into consideration that the recordset now has Input Text Controls for each visible cell. This is the function:


function deleteRow()

{

//you must select a row before you can delete, this means the index variable must hold an integer

if (index == null)

{

alert('You must select the row to delete.');

return;

}


//add the row to be deleted with its indication to the Transmitted Table.

includeInTransmittedTable('DELETED');


//replace the first six fields of the recordset row and all control fields with the word, DELETED

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

{

//form the input text control ID

CID = "EI" + index + j;

document.getElementById(CID).value = "DELETED";

}

}



The sort() Function

For the Single-Row Form, the sort() function had the line "showFirstRow()." Here there are no navigation buttons, so this line is not necessary. This is the new sort() function:



function sort()

{

//display a dialog box that prompts the user for input of title - Name is default

var title = prompt("Enter the Title of the Column for Sorting", "Name");

if ((title != null)&&(title != ""))

{

var titleInx = getColumnIndex(title); //the cell index of the recordset

if (titleInx == 6)

{

alert('The title does not exist or you typed it wrongly - type with the right case.');

return;

}

quickSort("0", (numberOfRows - 1), titleInx);

}


setTitleBool(title); //indicate in the titleBoolArr array that the column with the title is sorted

}





blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials