Home arrow HTML arrow Page 2 - Edit and Other Database Form Functions with HTML
HTML

Edit and Other Database Form Functions with HTML


This is the fifth part of a thirteen part series covering how to build database forms with HTML. We will start with a couple of edit functions and the deleteRow() function. Then we will go over the function that ties them all together and the function that completes the execution.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
August 06, 2008
TABLE OF CONTENTS:
  1. · Edit and Other Database Form Functions with HTML
  2. · The deleteRow() Function
  3. · The includeInTransmittedTable(Decision) Function
  4. · The finalize(ID) Function

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Edit and Other Database Form Functions with HTML - The deleteRow() Function
(Page 2 of 4 )

This function can be as complicated as you want, but I will make it very simple. The data you are currently seeing on the form is the one whose corresponding row in the recordset will be deleted.

You can click the Delete button whenever it is enabled. When you click it, the deleteRow() function is called. It first calls the “includeInTransmittedTable('DELETED')” function. The includeInTransmittedTable() function makes a copy of the row to be deleted in the Transmitted Table. The value “DELETED” is passed. As I said, this value will be the last piece of data in the copied row of the Transmitted Table. At the server, the program-file that receives the processed rows will use this data to know that this was a deleted row.

The function then goes on to write the word “DELETED” in all the fields of the corresponding row in the recordset, except the last field where the value remains –1. The function also writes the word “DELETED” in all the Input controls of the form. The data on the form corresponds to a particular row in the recordset. The position of this row is always indicated at the top-right area of the form. The is the code for the deleteRow() function:


function deleteRow()

{

//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

ID = "EI" + j;

//form the input text control ID

CID = "EI" + j;

 

document.getElementById('Recordset').rows[index].cells[j].innerHTML = "DELETED";

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

}

}


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