close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Cannot bind validated Entries to text fields

Thread began 9/17/2009 7:42 pm by andstafy104963 | Last modified 9/23/2009 11:12 am by Jason Byrnes | 3942 views | 7 replies |

andstafy104963

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>&nbsp;</td>
<td><input type="submit" name="contactbutton" id="contactbutton" value="Submit" /></td>
</tr>
</table>
</form>
</body>
</html>

Sign in to reply to this post

Jason ByrnesWebAssist

change lines 6:

php:
$_SESSION['WAVT_test_553_Errors'] = "";



and 16:

php:
PostResult($WAFV_Redirect,$WAFV_Errors,"test_553") ;



to:

php:
$_SESSION['WAVT_test_Errors'] = "";



and:

php:
PostResult($WAFV_Redirect,$WAFV_Errors,"test") ;
Sign in to reply to this post

andstafy104963

That Worked

But that particular code was automatically generated by validation toolkit, why would it add that in. I tried making a second form and it added _554 in both places, which I of course took out and that worked too.

Sign in to reply to this post

Jason ByrnesWebAssist

Hmmm, I'm not able to reproduce the problem.

Can you provide some details on your system so I can try recreating the problem in a similar environment:
What is you OS?
What Version of Dreamweaver?
What version of validation Toolkit? Or are you using Form Builder?



If your using Form Builder:
Did you have Validation Toolkit in stalled before installing form builder?
Did you uninstall validation toolkit before installing form builder?

Sign in to reply to this post

andstafy104963

Tech Details

Hi again Jason

I'm using Windows Vista Ultimate Edition with Dreamweaver CS3 with Form Builder 1.0.0

I did have validation toolkit installed before but I did uninstall it before I installed Form builder as per the instructions on the download page of Form Builder.

I tried uninstalling and reinstalling form builder as well (have also copied the files for the fix for While executing applyBehavior in WAFV_Required_C.htm... etc - although not relevant to this case as I'm using server validation).

I made a very simple form on a page called test.php and applied a "require/notblank/selection made server side validation. Once again a random number was added in this case 943... so I tried making another form and once again a number was added in, in this case 194... and it's always at the two places you pointed out ie $_SESSION['WAVT_test_194_Errors'] = ""; and PostResult($WAFV_Redirect,$WAFV_Errors,"test_194"); (I've supplied the full code below). I know the workaround to the problem is to search for this random number and delete it like you pointed out in your previous reply but for the life of me I don't know why it's added in.

<?php require_once("WA_ValidationToolkit/WAVT_Scripts_PHP.php"); ?>
<?php require_once("WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); ?>
<?php
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos($_SERVER["HTTP_REFERER"], $_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]) > 0) && isset($_POST)) {
$WAFV_Redirect = "";
$_SESSION['WAVT_test_194_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["textfield"]))?$_POST["textfield"]:"") . "",true,1);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"test_194");
}
}
?>
<!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="">
<p>
<input type="text" name="textfield" id="textfield" />
</p>
<p>
<input type="submit" name="button" id="button" value="Submit" />
</p>
</form>
</body>
</html>

Sign in to reply to this post

Jason ByrnesWebAssist

I think I have found the problem. The random number should be added, the problem is that it is not being added in the Validated Entries.


I am sending an updated file that should fix the issue. Please copy it into your dreamweaver configuration folder to:
/Configuration/DataSources/PHP_mySQL/WA_Validated_Entries.htm

Attached Files
WA_Validated_Entries.zip
Sign in to reply to this post

andstafy104963

Perfect

That has solved the problem. Thank you so much for your patience and persistence. It is greatly appreciated!

Sign in to reply to this post

Jason ByrnesWebAssist

Great, glad to hear it.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...