Home arrow HTML arrow More Database Form Functions with 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 / 5
July 30, 2008
  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

More Database Form Functions with HTML
(Page 1 of 6 )

The showNextRow() Function

If the user has just finished typing in the add-mode, the addMode variable would be true. If the user has just finished typing in the edit-mode, the editMode variable would be true. The function first checks if the user was in the add-mode. If he was there, it completes the Add process by calling other functions. Then it sets the add-mode variable to false. It then checks if the user was in the edit-mode. If he was there, it completes the Edit process by calling other functions and setting the edit-mode variable to false. It goes on to display the next row of the recordset. This is the code:

function showNextRow()


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

if (addMode == true)



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

addMode = false;


//enable the buttons that were disabled in the Add process



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

if (editMode == true)



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

editMode = false;


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




//display the next row

if ((numberOfRows - 1) > index)


index+=1; //the next 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 showNextRow and showLastRow Buttons if index is (numberOfRows - 1)

if (index == (numberOfRows - 1))




//enable the showFirstRow and showPreviousRow Buttons if they were disabled

if ((numberOfRows - 1) > index)





blog comments powered by Disqus

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


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