<td class="text">';
    $templateTools->swapBGColor($rowColor);
    // display the field's form label
    echo $templateTools->getPageLabel('[formLabel_' . $fieldName . ']');
    echo '</td>
        <td>';
    $itemType = $formFieldType[$indx];
    $itemName = ${$fieldName}->{$formItemName};
    $itemValue = ${$fieldName}->{$formItemValue};
    $itemError = ${$fieldName}->{$formItemError};
    // provided list of values should be named 'list_[fieldName]'
    $listName = 'list_' . $fieldName;
    if (!isset(${$listName})) {
        ${$listName} = array();
    }
    $templateTools->showByFormType($itemType, $itemName, $itemValue, $itemError, ${$listName}, 2000, 2010);
    echo "</td>\n    </tr>\n";
}
?>
</table>
<hr>
<input name="region_id" type="hidden" value="<?php 
echo $region_id;
?>
" />
<div align="middle"><input name="Add" type="submit" value="<?php 
if ($editEntryID != '') {
    echo $templateTools->getPageLabel('[Update]');
} else {
    echo $templateTools->getPageLabel('[Add]');
}
echo $templateTools->getPageLabel('[Title]');
?>
</span></p>
<p><span class="text"><?php 
echo $templateTools->getPageLabel('[Instr]');
?>
</span></p>

<?php 
// 2. campus selection jump list
$itemType = 'jumplist';
$itemName = 'year_id';
$itemValue = $yearJumpLinkSelectedValue;
$itemError = 'errorerror';
$listName = 'list_year_id';
echo $templateTools->showByFormType($itemType, $itemName, $itemValue, $itemError, ${$listName});
// 2. campus selection jump list
$itemType = 'jumplist';
$itemName = 'campus_id';
$itemValue = $campusJumpLinkSelectedValue;
$itemError = 'errorerror';
$listName = 'list_campus_id';
echo $templateTools->showByFormType($itemType, $itemName, $itemValue, $itemError, ${$listName});
?>

<br/>
<br/>

<table border="0" cellpadding="5">
    <tr>
        <td valign="top">
    <td> <div align="left" class="text">' . $rowValue . '</div></td>';
    $templateTools->swapBGColor($rowColor);
    // for each desired column to display ..
    foreach ($columnList as $colKey => $colValue) {
        // compile new Key
        $key = $rowKey . '_' . $colKey;
        if (isset($valueList[$key])) {
            $itemValue = $valueList[$key];
            //TODO?: add stripslashes() around $valueList [$key] to remove slashes added for storing apostrophes
        } else {
            $itemValue = '0';
        }
        // if item type is displayable
        if ($itemType != '-') {
            echo '<td>';
            $templateTools->showByFormType($itemType, $key, $itemValue, '', '');
            echo '</td>';
        }
        // end if item type is displayable
    }
    // next field
    echo '</tr>';
}
?>
 
</table>
<hr>
<div align="middle"><input name="Add" type="submit" value="<?php 
echo $templateTools->getPageLabel('[Update]');
?>
" /></div>
 */
// for each desired field to display ...
for ($indx = 0; $indx < count($formFieldList); $indx++) {
    // get the field name
    $fieldName = $formFieldList[$indx];
    $itemType = $formFieldType[$indx];
    if ($itemType == 'hidden') {
        $itemName = ${$fieldName}->{$formItemName};
        $itemValue = ${$fieldName}->{$formItemValue};
        $itemError = ${$fieldName}->{$formItemError};
        // provided list of values should be named 'list_[fieldName]'
        $listName = 'list_' . $fieldName;
        if (!isset(${$listName})) {
            ${$listName} = array();
        }
        $templateTools->showByFormType($itemType, $itemName, $itemValue, $itemError, ${$listName});
    } else {
        if ($itemType != '-') {
            echo '<tr valign="top"  >
        <td class="text" ' . $rowColor . ' >';
            echo $templateTools->getPageLabel('[formLabel_' . $fieldName . ']');
            echo '</td>
        <td>';
            $itemName = ${$fieldName}->{$formItemName};
            // HSMIT: (below) ensures that slashes added for DB storage of apostrophes are stripped when data shown in browser
            $itemValue = stripslashes(${$fieldName}->{$formItemValue});
            $itemError = ${$fieldName}->{$formItemError};
            // provided list of values should be named 'list_[fieldName]'
            $listName = 'list_' . $fieldName;
            if (!isset(${$listName})) {
                ${$listName} = array();
            $startYear = ${$startDateName};
        } else {
            $startYear = 2000;
        }
        // if a endYear value for this field was given
        $endDateName = 'endYear_' . $fieldName;
        if (isset(${$endDateName})) {
            $endYear = ${$endDateName};
        } else {
            $endYear = 2010;
        }
        $script = '';
        if ($itemName == 'list_freqvalue_id_2') {
            $script = $validateScript;
        }
        $templateTools->showByFormType($itemType, $itemName, $itemValue, $itemError, ${$listName}, $startYear, $endYear, $script);
        echo "</td>\r\n    </tr>\n";
    }
    // end if displayable
}
// next field
?>
</table>
<hr>
<div align="middle"><input name="formSubmit" type="submit" value="<?php 
echo $buttonText;
?>
" /></div>
</form>

<?php