Cannot bind validated Entries to text fields
Hi,
I've done this a thousand times before and it's always worked but ever since I removed Validation Toolkit and installed CSS Form Builder (also downloaded the fix and did that) I cannot for the life of me get the validated entries to bind to the text or comment fields. For example if I have three fields, name, email and comments and all are required. Let's say the visitor gets name and comments correct but makes a mistake with their email, when submitting, it's really annoying that although he/she gets alerted to the validation, their correct entries have vanished and they have to type them up again. Has anyone else run into this?
Here I've made a simple form as mentioned above and it's just not working... (the name of the page is test.php) Thank you in advance for any help.
<?php require_once("WA_ValidationToolkit/WAVT_Scripts_PHP.php"); ?>
<?php require_once("WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); ?>
<?php
if (isset($_POST["contactbutton"])) {
$WAFV_Redirect = "";
$_SESSION['WAVT_test_553_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["name"]))?$_POST["name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateEM(((isset($_POST["email"]))?$_POST["email"]:"") . "",true,2);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["comments"]))?$_POST["comments"]:"") . "",true,3);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"test_553");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td>Full Name</td>
<td><input name="name" type="text" id="name" value="<?php echo(ValidatedField("test","name")) ?>" size="32" /></td>
</tr>
<tr>
<td>email</td>
<td><input name="email" type="text" id="email" value="<?php echo(ValidatedField("test","email")) ?>" size="32" /></td>
</tr>
<tr>
<td>comments</td>
<td><textarea name="comments" cols="32" rows="4" id="comments"><?php echo(ValidatedField("test","comments")) ?></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="contactbutton" id="contactbutton" value="Submit" /></td>
</tr>
</table>
</form>
</body>
</html>