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.
More Database Form Functions with HTML - The showFirstRow() Function (Page 4 of 6 )
This function takes you, the user, to the first row when you are at a different row. This function is different from the setFirstRow() function. When you are at a row that is not the first row, going back to the first row takes into consideration certain things that are not taken into consideration when the web page is first opened. So the showFirstRow() function has to be different from the setFirstRow() function.
The code is:
function showFirstRow()
{
//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.