I'm very new to back-end web work and I'm trying to create a form for my theatre wherein someone can submit a space inquiry form. I have the form made, it works, but what I want it to do is after they hit 'submit' and the form is validated and emailed to us, they'll be redirected to a "thank you" page. I've tried using the behaviors in Dreamweaver CS3 but if I use onClick->goto URL, it will go, but if the page doesn't validate, I'll still get the incomplete warning and they have no chance to fix it. Right now, the validation works, but I don't have the onClick->goto URL in place and it just refreshes with a blank form.
Here's the PHP I've been using:
<?
if(sizeof($_POST)) {
$body = "";
while(list($key, $val) = each($HTTP_POST_VARS)) {
$body .= "$key: $val \n";
}
mail("[email protected]",
"Rental Request",
$body);
?>
here's the Javascript:
<form action=<? echo $PHP_SELF; ?> method="post" name="rentalRequest" onSubmit="MM_validateForm('firstName','','R','lastName','','R','organization','','R','emailAddress','','RisEmail','phone','','R','address1','','R','city','''R','guestNumber','','RisNum','timeStart','','R');return document.MM_returnValue">
I've spent the better part of the day researching this online and cannot find an answer. Any help would be greatly appreciated. I'm willing to send cookies to whomever can help me out.