<?
include 'functions.inc';
include 'table.inc';
include 'form_template.inc';
?>
<html>
<head><title>Form Template Test</title>
<LINK HREF="test.css" REL="stylesheet" TYPE="text/css">
<SCRIPT LANGUAGE="JavaScript1.2" SRC="validate.js"></SCRIPT>
<?
$form = new form_template;
$form->conf_file_name = 'test.conf';
$form->initialise();
echo $form->javascript_validation_array; // print array that contains validation info for all fields.
?>
</head>
<body>
<?
if (isset($HTTP_POST_VARS) and ($form_action!='cancel')) {
$form->validate($HTTP_POST_VARS);
$form->make_table();
if (isset($form->validation_error)) {
print("<H2>Validation Error</H2>");
print $form->table;
} else if ($form_action=='apply') print $form->table; //print table if we selected "apply".
} else {
$form->make_table();
print $form->table;
}
if (isset($HTTP_POST_VARS)) { // print returned vars.
print('<PRE>');
print_r($HTTP_POST_VARS);
print('</PRE>');
}
?>
</body>
</html>
|