close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Validation Question

Thread began 10/25/2012 2:26 pm by Justin@AdventDesign | Last modified 10/25/2012 3:13 pm by Jason Byrnes | 518 views | 1 replies |

Justin@AdventDesign

Validation Question

I have an eCart generated checkout system. I didn't orginally include any form validation, but went back to add it later.

I have this code on my checkout.php page:

<?php
if (ValidatedField('confirm_021','confirm_021')) {
if ((strpos((",".ValidatedField("confirm_021","confirm_021").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<p class="validate">You must enter a valid email address</p>
<?php //WAFV_Conditional confirm.php confirm_021(1:)
}
}
}?>

And this code on my confirm page that sends you back to checkout if things don't validate:

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "checkout.php";
$_SESSION['WAVT_confirm_021_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateEM(((isset($_POST["email"]))?$_POST["email"]:"") . "",true,1);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"confirm_021");
}
}
?>

My problem is, when it returns you to the checkout page to fix your invalid entry, it doesn't hold all the entered data in the form so the user has to re-enter all their data. How do I get it to hold the previous entries? Does it have something to do with session variables?

Sign in to reply to this post

Jason ByrnesWebAssist

In the bindings panel, you should see a binding group called validated entries.

for each form element, set the initial value to use the corresponding binding from the validated entries biding group.

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