Home arrow HTML arrow Page 2 - More Database Form Functions with HTML
HTML

More Database Form Functions with HTML


This is the fourth chapter of a thirteen part series regarding the creation of database forms with HTML. In this article we will continue discussing the functions relevant to the development process, including showNextRow(), showLastRow(), showFirstRow(), addRow(), and addRowToRecordset(). Join us as we edge toward completion.

Author Info:
By: Chrysanthus Forcha
Rating: 3 stars3 stars3 stars3 stars3 stars / 4
July 30, 2008
TABLE OF CONTENTS:
  1. · More Database Form Functions with HTML
  2. · The showPreviousRow() Function
  3. · The showLastRow() Function
  4. · The showFirstRow() Function
  5. · The addRow() function
  6. · The addRowToRecordset() Function

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
More Database Form Functions with HTML - The showPreviousRow() Function
(Page 2 of 6 )

The main role of this function is to show the previous row.


function showPreviousRow()

{

//add to recordset any data that might have been included in the controls

if (addMode == true)

{

addRowToRecordset();

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

addMode = false;

makeReadOnlyInputControls();

//enable the buttons that were disabed in the add process

enableButtons('E1','D1','F1','So1');

}

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

if (editMode == true)

{

editRowToRecordset();

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

editMode = false;

makeReadOnlyInputControls();

//enable the buttons, Edit, Delete, Clear, Find, Sort.

enableButtons('E1','D1','C1','F1','So1');

}


if (index > 0)

{

index-=1; //the previous index

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

{

//form the input text control ID

CID = "EI" + j;

//form the recordset ID

RID = "TD" + index + j;

 

document.getElementById(CID).value = document.getElementById(RID).innerHTML;

}

}


//show the data row number

document.getElementById('RowPosition').value = index + 1;

 

//disable the showFirstRow and showPreviousRow Buttons if index is 0

if (index == 0)

{

disableButtons('SFA1','SP1');

}

//enable the showNextRow and showLastRow Buttons if they were disabled

if (index < numberOfRows)

{

enableButtons('SN1','SL1');

}

}


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 2 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials