close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Modifying contact form

Thread began 2/19/2010 12:06 am by toby379423 | Last modified 2/22/2010 9:19 am by Jason Byrnes | 2281 views | 5 replies |

toby379423

Modifying contact form

Hello,

I'm having issues modifying the contact form, maybe from lack of sleep...

Anyways, I've tried to add new fields and remove the security questions along with a few other things with the default contactus.php page and after submitting, don't get an email confirmation, but I'm pretty sure I'm doing something wrong, just not sure where:

contactus.php

Here is the code:

<?php require_once('WA_Globals/WA_Globals.php');?>
<?php require_once("WA_ValidationToolkit/WAVT_Scripts_PHP.php"); ?>
<?php require_once("WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); ?>
<?php require_once("WA_Universal_Email/mail_PHP.php"); ?>
<?php require_once("WA_Universal_Email/MailFormatting_PHP.php"); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "";
$_SESSION['WAVT_contact_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Contact_Name"]))?$_POST["Contact_Name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateEM(((isset($_POST["Email_address"]))?$_POST["Email_address"]:"") . "",true,8);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Comments"]))?$_POST["Comments"]:"") . "",true,3);
$WAFV_Errors .= WAValidateRX(((isset($_POST["addblock"]))?$_POST["addblock"]:"") . "","/^$/i",false,6);
$WAFV_Errors .= WAValidateRX(((isset($_POST["seconddblock"]))?$_POST["seconddblock"]:"") . "","/^$/i",false,7);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
}
}
?>
<?php
if ((($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST))) {
//WA Universal Email object="mail"
//Send Loop Once Per Entry
$RecipientEmail = "".($WAGLOBAL_Contact_Email_To) ."";include("WA_Universal_Email/WAUE_contact_1.php");

//Send Mail All Entries
if ("index.php"!="") {
header("Location: thankyou.php");
}
}
?>
<!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>Contact Us</title>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>
<style>
body {
background-color: #e8dbb1;
font-family:Helvetica, sans-serif;
}

p {
font-size:12px;
color:#000;
line-height:140%;
text-align:justify;
}

a {
color:#7A5551;
}

.textfieldServerError {
display:block;
margin:0px;
color:#CC3333;
border: 1px solid #CC3333;
}
.red {
color: #F00;
}
</style>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Reservation Request Form</h1>

<p>All reservations are tentative until confirmed by telephone or e-mail.</p>

<p>Please read the terms and policies carefully before you make a reservation request.</p>

<p>When filling out this form, please remember that this is only a request, not a guaranteed reservation. A reservationists will contact you by e-mail or telephone to discuss and confirm your advance reservation.</p>

<p>You may also <a href="http://www.webervations.com/magic-scripts/resbook.asp?memberid=780">Click here to Check Room Availability</a></p>

<p>(<span class="red">* = required field</span>)</p>

<p><strong>CONTACT INFORMATION</strong></p>

<form action="" method="post" name="emailContact" id="emailContact" onsubmit="">
<div style="width:100%">
<label for="Contact_Name" >Your Name:</label>
<br />
<span id="sprytextfield1">
<input name="Contact_Name" type="text" class="inputValue" id="Contact_Name" onblur="if (document.getElementById('nameServerError')) document.getElementById('nameServerError').style.display='none'" value="<?php echo(ValidatedField("contact","Contact_Name")) ?>" />
<span class="textfieldRequiredMsg">A value is required.</span></span>
<input name="addblock" type="text" id="addblock" style="display:none" value="" />
<?php
if (ValidatedField("contact","contact")) {
if ((strpos((",".ValidatedField("contact","contact").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<span id="nameServerError" class="textfieldServerError">Please provide your name.</span>
<?php //WAFV_Conditional contact.php contact(1:)
}
}
}?>
<br />
<label for="address" >Address:</label>
<br />
<input name="address" type="text" class="inputValue" id="address" />
<br />
<label for="address" >City:</label>
<br />
<input name="city" type="text" class="inputValue" id="city" />
<label for="address" ><br />State/Province:</label>
<br />
<input name="state" type="text" class="inputValue" id="state" />
<label for="address" ><br />Country:</label>
<br />
<input name="country" type="text" class="inputValue" id="country" />
<input name="seconddblock" id="seconddblock" type="text" style="display:none" value="" />
<label for="address" ><br />Zip Code:</label>
<br />
<input name="zip" type="text" class="inputValue" id="zip" />
<br />
<label for="Email_address" >E-mail:</label>
<br />
<input name="Email_address" type="text" class="inputValue" id="Email_address" />
<br />
<label for="home_phone" >Home Phone:</label>
<br />
<input name="home_phone" type="text" class="inputValue" id="home_phone" />
<br />
<label for="work_phone" >Work Phone:</label>
<br />
<input name="work_phone" type="text" class="inputValue" id="work_phone" />
<br />
<label for="best_time" >Best Time to Call:</label>
<br />
<input name="best_time" type="text" class="inputValue" id="best_time" />
<br />
<p><strong>RESERVATION INFORMATION</strong></p>
<label for="arrival" >Arrival Date:</label>
<br />
<input name="arrival" type="text" class="inputValue" id="arrival" />
<br />
<label for="departure" >Departure Date:</label>
<br />
<input name="departure" type="text" class="inputValue" id="departure" />
<br />
<p>
<label for="room_type">Room Type:</label><br />
<label>
<input type="radio" name="Room Type" value="radio" id="RoomType_0" />
Type A</label>
<br />
<label>
<input type="radio" name="Room Type" value="radio" id="RoomType_1" />
Type B</label>
<br />
<label>
<input type="radio" name="Room Type" value="radio" id="RoomType_2" />
Type C</label>
<br />
</p>
<label for="adults" ># of Adults:</label>
<br />
<input name="adults" type="text" class="inputValue" id="adults" />
<br />
<label for="children" ># of Children (under 4):</label>
<br />
<input name="children" type="text" class="inputValue" id="children" />
<br />
<p>
<label for="options" >Reservation Option:<br/>(Consult list of specials)</label><br />
<label>
<input type="radio" name="ReservationOption" value="radio" id="ReservationOption_0" />
Escape Holiday</label>
<br />
<label>
<input type="radio" name="ReservationOption" value="radio" id="ReservationOption_1" />
Holiday Specials</label>
<br />
<label>
<input type="radio" name="ReservationOption" value="radio" id="ReservationOption_2" />
Penny Pincher Special</label>
<br />
<label>
<input type="radio" name="ReservationOption" value="radio" id="ReservationOption_3" />
Super Saver</label>
<br />
<label>
<input type="radio" name="ReservationOption" value="radio" id="ReservationOption_4" />
Extended Stay</label>
<br />
<label>
<input type="radio" name="ReservationOption" value="radio" id="ReservationOption_5" />
No Frills Special</label>
<br />
<label>
<input type="radio" name="ReservationOption" value="radio" id="ReservationOption_6" />
Fab '50s Weekend</label>
<br />
<label>
<input type="radio" name="ReservationOption" value="radio" id="ReservationOption_7" />
Salute the '60s Weekend</label>
</p>
<br />
<label for="needs" >Additional Needs:</label>
<br />
<textarea name="needs" class="inputText" id="needs"></textarea>
<br />
<input type="submit" value="Submit" class="inputButton"/>
</div>
</form>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"]});
//-->
</script>
</body>
</html>

Any help would be greatly appreciated!

Sign in to reply to this post

neilo

Hiya Toby,

You will either need to set the relevant fields (as given in the WA Server Validation server behaviour) to validate, or remove the surplus WA Server Validations, which you can do manually or by double-clicking the 'WA Server Validations' in the Server Behaviors panel, selecting the redundant validations and then clicking the minus symbol.

Out of:

$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Contact_Name"]))?$_POST["Contact_Name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateEM(((isset($_POST["Email_address"]))?$_POST["Email_address"]:"") . "",true,8);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Comments"]))?$_POST["Comments"]:"") . "",true,3);
$WAFV_Errors .= WAValidateRX(((isset($_POST["addblock"]))?$_POST["addblock"]:"") . "","/^$/i",false,6);
$WAFV_Errors .= WAValidateRX(((isset($_POST["seconddblock"]))?$_POST["seconddblock"]:"") . "","/^$/i",false,7);



all that is currently functional is:

$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Contact_Name"]))?$_POST["Contact_Name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateRX(((isset($_POST["addblock"]))?$_POST["addblock"]:"") . "","/^$/i",false,6);



Removing the other lines should allow the form to send, but as only the 'name' field is being validated, without adding validations to more of your fields and having catcha enabled, you can expect to end up receiving quite a few emails advertising suspect pharmaceuticals.

I would have thought your best bet was to start with a clean Contact Form Solution Pack 'contactus.php' page, and then add fields as described in the Inserting Additional form fields to your Contact Form 'how to' pdf.

Sign in to reply to this post

ablehands401419

Link to how to's?

Is there a link to a library of how to's? The link you posted above is the first I have seen of any how to's.

I'm sure once I figure out all of the functionality of this extension it will be great. But as a non-programmer I've had a heck of a time getting the forms to do what I want. Lot's of hunting around with minimal results. Having acccess to all of the how to's would be great.

Matt

Sign in to reply to this post

neilo

Hi Matt,



There are two ways to get to the support files and resources for the extensions and solutions.

1. When you buy a product, it is listed in your account's 'Your Downloads' page. Sign in to your account, click on 'Download Your Products', find the product in the list and click on 'View Product Downloads'. This will give you access to any guides, support resources, 'how-tos' and support files that are available for your product.

2. Go to the WebAssist Support page and select the extension or solution from the drop-down (select) list where it says 'Choose a product to view its support documentation'.

Sign in to reply to this post

ablehands401419

Validation too?

Niello,

Thank you for the response. That really helps. When I go to add fields to my form, will the validation check be added as well or do I need to take additional steps?

Sign in to reply to this post

Jason ByrnesWebAssist

you will need to add validation for any form fields you add to the contact form solution pack using the Server Validation portion of the CSS Form Builder extension.


If you have CSS Form builder installed, you can double click the Server Validations server behavior to add new validations.

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