close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Form Tool Newbie

Thread began 12/07/2010 1:41 pm by jbprincipato1419364 | Last modified 12/08/2010 12:19 pm by jbprincipato1419364 | 1380 views | 7 replies

jbprincipato1419364

Form Tool Newbie

Sorry, newbie here. I just purchased the form toolkit. I am trying to configure server validation on a test form and I can't get it to show the error message and reload the form page. I created a form (test1.php) with one text field in it (tst_txt), set the action to test2.php, method is post.

I followed the instructions and select Web Assist forms/ Validation/ Server Validation. I filled out the validation form by selecting any form post/required/not blank/selection made, server variable tst_txt, clicked the + sign, selected test1.php as the failed redirect, pressed ok.

Then I selected the error message text on the page, selected webassist/validation/showif. Then I selected test1.php as the validation page/validation fail - any/tst_txt reqired code. Pressed ok.

When I run the form it always goes to test2.php whether I enter text into the field or not.

Below is the php that was generated by webassist form toolkit:

<?php require_once("webassist/form_validations/wavt_scripts_php.php"); ?>
<?php require_once("webassist/form_validations/wavt_validatedform_php.php"); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "test1.php";
$_SESSION['WAVT_test1_470_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["tst_txt"]))?$_POST["tst_txt"]:"") . "",true,1);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"test1_470");
}
}
?>
<!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>
<link type="text/css" href="webassist/datepicker/test1_datepicker_1/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript" src="webassist/jquery/jquery.js"></script>
<script type="text/javascript" src="webassist/jquery/jquery-ui.js"></script>
<script type="text/javascript">
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'yy-mm-dd',
showAnim: 'show',
onClose: closeDatePicker_datepicker_1
});
});
function closeDatePicker_datepicker_1() {
var tElm = $('#datepicker_1');
if (typeof datepicker_1_Spry != null && typeof datepicker_1_Spry != "undefined") {
datepicker_1_Spry.validate();
}
var docElm = document.getElementById("datepicker_1");
var tBlur = docElm.getAttribute("onBlur");
if (!tBlur) tBlur = docElm.getAttribute("onblur");
if (!tBlur) tBlur = docElm.getAttribute("ONBLUR");
if (tBlur) {
tBlur = tBlur.replace(/\bthis\b/g, "docElm");
eval(tBlur);
}
}
</script>
</head>

<body>
<form action="test2.php" method="post">
<p>test:
<input type="text" name="tst_txt" id="tst_txt" />
<?php
if (ValidatedField('test1_470','test1_470')) {
if ((strpos((",".ValidatedField("test1_470","test1_470").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
This is an error message
<?php //WAFV_Conditional test1.php test1_470(1:)
}
}
}?>
</p>
<p>
<input name="Submit" type="Submit" value="Submit" />
</p>
</form>
</body>
</html>

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...