<?php
$errMsg = "";
$showForm = true;
$showConf = false;
$genStr = "A9I38IT";
include("class.easyformproc.inc.php");
//Create Instance
$formGen = new easyFormProc();
#Set Elements
$formGen -> setTextElement("text1","HelloWorld",30,25,"txtboxes","valCheckEqual","Value Mismatch",array($genStr));
#Process Form
$disForm = $formGen -> processForm("Check Value","buttons");
#Get HTML of the elements
$disElementHTML = $formGen -> getDisElementHTML();
#Get Error Messages
$errMsg = $formGen -> getErrorMsg("The following errors occured","style2");
#Get Posted Values
$postedVals = $formGen -> getPostedElementValues();
#If Form is posted
if(count($postedVals)){
#Preview values
echo "<pre>";
print_r($postedVals);
echo "</pre>";
/*
#Process Posted Values
*/
$showForm=false;
$showConf=true;
}
?>
<html>
<head>
<title>Passing additional parameters to validation function</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="4">
<?php
if($showForm){
echo $disForm["form"]["start"];
?>
<tr>
<td colspan="2" class="style1"><strong>Upload File </strong></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><?php echo $errMsg;?></td>
</tr>
<tr class="style1">
<td colspan="2"><span class="style3"><?php echo $genStr;?></span></td>
</tr>
<tr>
<td width="236" class="style1">Enter above value <span class="style2"></span></td>
<td width="248"><?php echo $disElementHTML["text1"];?></td>
</tr> <tr>
<td class="style1"> </td>
<td align="right"><?php echo $disForm["submit"];?></td>
</tr>
<?php
echo $disForm["form"]["end"];
}
if($showConf){
?>
<tr>
<td class="style1" colspan="2">Values Successfully posted.</td>
</tr>
</table>
<?php
}
?>
</body>
</html>
|