close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Basic Contact form as plugin

Thread began 5/09/2011 7:34 am by MikeH | Last modified 5/10/2011 9:50 am by Jason Byrnes | 1764 views | 9 replies |

MikeH

Basic Contact form as plugin

Hi
I have created a blank PHP page and added a simple contact form to it.

I have then used a statci plugin to insert the form page into another page.

Now I know about redirecting the form to the page that the form is plgged into not the actual form page.

Problem seems to be that if the server validation fails you are returned to the page but the form is blank again and needs filling out still.

Any solution to do this correctly?

thanks

Mike

Sign in to reply to this post

Jason ByrnesWebAssist

for each form element on the form, click the lightning bolt next to initial value and select the corresponding item from the Validated entries binding group.

Sign in to reply to this post

MikeH

Hi Jason
They are all set already.


Please find attached the page with the form. This is then plugged in to a page called contactus.php (outside the plugin directory)

Thanks

Mike

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

Jason ByrnesWebAssist

please post a link where i can see the problem and a copy of the contactus.php page.

Sign in to reply to this post

MikeH

Yep sure

<link removed>

Jason can you please remove th link as soon as you have it thanks..

Mike

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

Jason ByrnesWebAssist

you have form validation on the contactus.php page at line 5 - 24:
<?php
if (isset($_POST["SimpleContact_submit_x"]) && !isset($_GET["invalid"])) {
$WAFV_Redirect = "addins/contactform1.php";
$_SESSION['WAVT_contactus_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ((isset($_POST["Full_Name"])?$_POST["Full_Name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateEM((isset($_POST["Email_Address"])?$_POST["Email_Address"]:"") . "",true,2);
$WAFV_Errors .= WAValidateLE((strtolower(isset($_POST["Security_Code"])?$_POST["Security_Code"]:"")) . "",((isset($_SESSION["captcha_Security_Code"]))?strtolower($_SESSION["captcha_Security_Code"]):"") . "",true,3);
$WAFV_Errors .= WAValidateLE((strtolower(isset($_POST["Security_Answer"])?$_POST["Security_Answer"]:"")) . "",((isset($_SESSION["random_answer"]))?strtolower($_SESSION["random_answer"]):"") . "",true,4);
$WAFV_Errors .= WAValidateRX((isset($_POST["Hidden_Field"])?$_POST["Hidden_Field"]:"") . "","/.*/",false,5);

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


this validation should not be on both the contact page and the addins/contactform1.php


this line is causing the problem:
$WAFV_Redirect = "addins/contactform1.php";


it should be:
$WAFV_Redirect = "";

Sign in to reply to this post

MikeH

Hi
Removed the lines from contactus.php I honestly do not know how they got there as I have never added validation to that page.

Now when the page is submitted it cannot reload the page you get an error saying page is unavailable so you refresh and the page loads with a blank form and the verification showing there had been a mistake during validation.

Oh and despite the failed validation the emails are still sent out.

Any ideas?

Mike

Sign in to reply to this post

Jason ByrnesWebAssist

your contact us page also has a universal email behavior on it that should not be there.

Sign in to reply to this post

MikeH

Hi Jason
This jas got me I never put anything on that page and when I removed the plugin from the page the Universal email and validations removed too.

Ive re-added it but still no luck when you submit the form it will not load.

Mike

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post
loading

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