close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Hello, UE3 & t get attachment send jquery form validation page, sends email attachmen works fine validation preventing attachment being sent

Thread began 7/03/2013 6:50 pm by Timespider | Last modified 7/05/2013 10:03 am by Timespider | 504 views | 1 replies


Universal email 3 - Attachment won't send with jquery form validation

Hello, I have UE3 & can't get the attachment to send when I have jquery form validation on the page, it sends the email but no attachment. It works fine if there is no form validation. What is preventing the attachment being sent? Here's my page code. Thanks Chris.

<?php require_once("webassist/email/mail_php.php"); ?> <?php require_once("webassist/email/mailformatting_php.php"); ?> <?php if (!isset($_SESSION))session_start(); if ((isset($_POST["submit"]))) { //WA Universal Email object="mail" set_time_limit(0); $EmailRef = "waue_test_universal_email_attachment_3"; $BurstSize = 200; $BurstTime = 1; $WaitTime = 1; $GoToPage = ""; $RecipArray = array(); $StartBurst = time(); $LoopCount = 0; $TotalEmails = 0; $RecipIndex = 0; // build up recipients array $CurIndex = sizeof($RecipArray); $RecipArray[$CurIndex] = array(); $RecipArray[$CurIndex ][] = ""; $TotalEmails += sizeof($RecipArray[$CurIndex]); $RealWait = ($WaitTime<0.25)?0.25:($WaitTime+0.1); $TimeTracker = Array(); $TotalBursts = floor($TotalEmails/$BurstSize); $AfterBursts = $TotalEmails % $BurstSize; $TimeRemaining = ($TotalBursts * $BurstTime) + ($AfterBursts*$RealWait); if ($TimeRemaining < ($TotalEmails*$RealWait) ) { $TimeRemaining = $TotalEmails*$RealWait; } $_SESSION[$EmailRef."_Total"] = $TotalEmails; $_SESSION[$EmailRef."_Index"] = 0; $_SESSION[$EmailRef."_Remaining"] = $TimeRemaining; while ($RecipIndex < sizeof($RecipArray)) { $EnteredValue = is_string($RecipArray[$RecipIndex][0]); $CurIndex = 0; while (($EnteredValue && $CurIndex < sizeof($RecipArray[$RecipIndex])) || (!$EnteredValue && $RecipArray[$RecipIndex][0])) { $starttime = microtime_float(); if ($EnteredValue) { $RecipientEmail = $RecipArray[$RecipIndex][$CurIndex]; } else { $RecipientEmail = $RecipArray[$RecipIndex][0][$RecipArray[$RecipIndex][2]]; } $EmailsRemaining = ($TotalEmails- $LoopCount); $BurstsRemaining = ceil(($EmailsRemaining-$AfterBursts)/$BurstSize); $IntoBurst = ($EmailsRemaining-$AfterBursts) % $BurstSize; if ($AfterBursts<$EmailsRemaining) $IntoBurst = 0; $TimeRemaining = ($BurstsRemaining * $BurstTime * 60) + ((($AfterBursts<$EmailsRemaining)?$AfterBursts:$EmailsRemaining)*$RealWait) - (($AfterBursts>$EmailsRemaining)?0:($IntoBurst*$RealWait)); if ($TimeRemaining < ($EmailsRemaining*$RealWait) ) { $TimeRemaining = $EmailsRemaining*$RealWait; } $CurIndex ++; $LoopCount ++; session_commit(); session_start(); $_SESSION[$EmailRef."_Index"] = $LoopCount; $_SESSION[$EmailRef."_Remaining"] = round($TimeRemaining); session_commit(); wa_sleep($WaitTime); include("webassist/email/waue_test_universal_email_attachment_3.php"); $endtime = microtime_float(); $TimeTracker[] =$endtime - $starttime; $RealWait = array_sum($TimeTracker)/sizeof($TimeTracker); if ($LoopCount % $BurstSize == 0) { $TimePassed = (time() - $StartBurst); if ($TimePassed < ($BurstTime*60)) { $WaitBurst = ($BurstTime*60) -$TimePassed; wa_sleep($WaitBurst); } else { $TimeRemaining = ($TotalEmails- $LoopCount)*$RealWait; } $StartBurst = time(); } if (!$EnteredValue) { $RecipArray[$RecipIndex][0] = mysql_fetch_assoc($RecipArray[$RecipIndex][1]); } } $RecipIndex ++; } $_SESSION[$EmailRef."_Total"] = 0; $_SESSION[$EmailRef."_Index"] = 0; $_SESSION[$EmailRef."_Remaining"] = 0; session_commit(); session_start(); if ($GoToPage!="") { header("Location: ".$GoToPage); } } ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <link rel="stylesheet" type="text/css" href="CSS/validate.css"> <script src="jquery-1.4.4.js" type="text/javascript"></script> <script src="jquery.validate.js"></script> <script> $(function(){ $("#myForm").validate({ rules:{ name: { required:true }, gender: { required:true }, age: { required:true }, raceexperience: { required:true }, whywin: { required:true }, email: { required:true }, phone: { required:true }, live: { required:true }, bike: { required:true }, agree: { required:true } } }); }); </script> <style type="text/css"> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; } --> </style></head> <body> <table width="415" border="0" cellpadding="4" cellspacing="0" bgcolor="#FF3333"> <tr> <td><form action="" method="post" enctype="multipart/form-data" name="myForm" id="myForm"> <table width="415" border="1" cellspacing="0" cellpadding="4"> <tr> <td><label for="label">Name</label></td> <td><input type="text"id="name" name="name"/></td> </tr> <tr> <td><label for="label">Gender</label></td> <td> <input id="male" type="radio" name="gender" value="male" /> male</label> <input id="female" type="radio" name="gender" value="female" /> female</label></td> </tr> <tr> <td><label for="label">Age</label></td> <td><input type="text" id="age" name="age" maxlength="3"/></td> </tr> <tr> <td><label for="label">Race experience/results</label></td> <td><textarea id="raceexperience" name="raceexperience" cols="25" rows="5"></textarea></td> </tr> <tr> <td><label for="label">Why you should win</label></td> <td><textarea id="whywin" name="whywin" cols="25" rows="5"></textarea></td> </tr> <tr> <td><label for="label">Email</label></td> <td><input type="text" id="email" name="email"/></td> </tr> <tr> <td><label for="label">Phone number</label></td> <td><input type="text" id="phone" name="phone"/></td> </tr> <tr> <td><label for="label">Where do you live</label></td> <td><input type="text" id="live" name="live"/></td> </tr> <tr> <td><label for="label">Current bike</label></td> <td><input type="text" id="bike" name="bike"/></td> </tr> <tr> <td><label for="label">Photo of you on bike</label></td> <td><label for="photo"></label> <input type="file" name="file" id="photo"/></td> </tr> <tr> <td><label for="label">I have read &amp; agree to the terms</label></td> <td><input type="checkbox" id="agree" name="agree"/></td> </tr> <tr> <td colspan="2"><div align="right"> <input name="submit" type="submit"? /> </div></td> </tr> </table> </form></td> </tr> </table> </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





Ease of use


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