Jquery Form Plugin Breaking in IE
Hello all,
I'm trying to implement the jquery form plugin for a client. The form is working in Chrome, but in IE(11) it's not working.
I've looked through the core as much as i can but can't seem to figure it out.
HTML:
- <?php
- sleep(.5);
- //Sanitize incoming data and store in variable
- //customer info
- $name = trim(stripslashes(htmlspecialchars($_POST['cusName'])));
- $address = trim(stripslashes(htmlspecialchars($_POST['cusAddress'])));
- $city = trim(stripslashes(htmlspecialchars($_POST['city'])));
- $state = trim(stripslashes(htmlspecialchars($_POST['state'])));
- $zip = trim(stripslashes(htmlspecialchars($_POST['zip'])));
- $homePhone = trim(stripslashes(htmlspecialchars($_POST['homePhone'])));
- $homePhoneLink = preg_replace('/\D+/', '', $homePhone);
- $workPhone = trim(stripslashes(htmlspecialchars($_POST['workPhone'])));
- $workPhoneLink = preg_replace('/\D+/', '', $workPhone);
- $cellPhone = trim(stripslashes(htmlspecialchars($_POST['cellPhone'])));
- $cellPhoneLink = preg_replace('/\D+/', '', $cellPhone);
- //vehicle info
- $year = trim(stripslashes(htmlspecialchars($_POST['year'])));
- $make = trim(stripslashes(htmlspecialchars($_POST['make'])));
- $model = trim(stripslashes(htmlspecialchars($_POST['model'])));
- $bodyStyle = trim(stripslashes(htmlspecialchars($_POST['bodyStyle'])));
- $vin = trim(stripslashes(htmlspecialchars($_POST['vin'])));
- $damagedGlass = trim(stripslashes(htmlspecialchars($_POST['damagedGlass'])));
- //insurance info
- $insCompany = trim(stripslashes(htmlspecialchars($_POST['insCompany'])));
- $agency = trim(stripslashes(htmlspecialchars($_POST['agency'])));
- $policy = trim(stripslashes(htmlspecialchars($_POST['policy'])));
- $sentBy = trim(stripslashes(htmlspecialchars($_POST['sentBy'])));
- $compCoverage = trim(stripslashes(htmlspecialchars($_POST['compCoverage'])));
- $deductible = trim(stripslashes(htmlspecialchars($_POST['deductible'])));
- $dateOfLoss = trim(stripslashes(htmlspecialchars($_POST['dateOfLoss'])));
- $causeOfLoss = trim(stripslashes(htmlspecialchars($_POST['causeOfLoss'])));
- $replyEmail = trim(stripslashes(htmlspecialchars($_POST['replyEmail'])));
- $specialInstructions = trim(stripslashes(htmlspecialchars($_POST['specialInstructions'])));
- //spam filters
- $humancheck = $_POST['humancheck'];
- $honeypot = $_POST['honeypot'];
- $answer = $_POST['answer'];
- $c = $_POST['value1'] + $_POST['value2'];
- if ($honeypot == 'http://' && empty($humancheck)) {
-
- //Validate data and return success or error message
- $error_message = '';
- $reg_exp = "/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,4}$/";
-
-
- if (empty($name)) {
- $error_message .= "<p>CUSTOMER NAME IS REQUIRED.</p>";
- }
-
- if ($answer != $c) {
- $error_message .= "<p>PLEASE RE-ENTER YOUR SIMPLE MATH ANSWER AND TRY AGAIN.</p>";
- }
-
- /*if (empty($address)) {
- $error_message .= "<p>Customer address is required.</p>";
- }
- if (empty($city)) {
- $error_message .= "<p>Customer city is required.</p>";
- }
- if (empty($state)) {
- $error_message .= "<p>Customer state is required.</p>";
- }
- if (empty($zip)) {
- $error_message .= "<p>Customer zip is required.</p>";
- }
- if (empty($homePhone) || empty($workPhone) || empty($cellPhone)) {
-
- $error_message .= "<p>Please provide at least one phone number for the customer.</p>";
- }
- if (empty($year)) {
- $error_message .= "<p>Vehicle year is required.</p>";
- }
- if (empty($make)) {
- $error_message .= "<p>Vehicle make is required.</p>";
- }
- if (empty($model)) {
- $error_message .= "<p>Vehicle model is required.</p>";
- }
- if (empty($bodyStyle)) {
- $error_message .= "<p>Vehicle body style is required.</p>";
- }
- if (empty($vin)) {
- $error_message .= "<p>Vehicle VIN number is required.</p>";
- }
- if (empty($damagedGlass)) {
- $error_message .= "<p>Vehicle\'s damaged glass is required.</p>";
- }
- if (empty($insCompany)) {
- $error_message .= "<p>Insurance company is required.</p>";
- }
- if (empty($agency)) {
- $error_message .= "<p>Insurance agency is required.</p>";
- }
- if (empty($policy)) {
- $error_message .= "<p>Policy number is required.</p>";
- }
- if (empty($sentBy)) {
- $error_message .= "<p>The \"sent by\" field is required.</p>";
- }
- if (empty($compCoverage)) {
- $error_message .= "<p>Comp Coverage is required.</p>";
- }
- if (empty($deductible)) {
- $error_message .= "<p>Deductible ammount is required.</p>";
- }
- if (empty($dateOfLoss)) {
- $error_message .= "<p>Date of loss is required.</p>";
- }
- if (empty($causeOfLoss)) {
- $error_message .= "<p>Cause of loss is required.</p>";
- }*/
- if (!preg_match($reg_exp, $replyEmail)) {
- $error_message .= "<p>A VANILD REPLY EMAIL ADDRESS IS REQUIRED.</p>";
- }
-
-
- if (!empty($error_message)) {
- $return['error'] = true;
- $return['msg'] = '<div class="alert alert-danger">'."<h4>OOPS! THE FORM WAS NOT SUBMITTED.</h4>".$error_message;
- echo json_encode($return);
- exit();
- }
-
- else {
- //mail variables
- #$to = 'claims@kkglass.com';
- $to = 'Jason@mainstreetcomp.com';
- $from = $_POST['replyEmail'];
- $headers = 'From: '.$from."\r\n";
- $headers .= 'MIME-Version: 1.0' . "\r\n";
- $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
- $subject = "Glass Referral From Website\n";
-
- $body = '<h4>Customer Information</h4>';
- $body .= '<p>Name: '.$name."<br />";
- $body .= 'Address: '.$address.'; '.$city.', '.$state.' '.$zip.'<br />';
- if(isset ($homePhone) && $homePhone != '') {
- $body .= 'Home Phone: '.'<a href="tel:+1'.$homePhoneLink.'">'.$homePhone."</a><br />";
- }
- if(isset ($workPhone) && $workPhone != '') {
- $body .= 'Work Phone: '.'<a href="tel:+1'.$workPhoneLink.'">'.$workPhone."</a><br />";
- }
- if(isset ($cellPhone) && $cellPhone != '') {
- $body .= 'Cell Phone: '.'<a href="tel:+1'.$cellPhoneLink.'">'.$cellPhone."</a><br />";
- }
- $body .= '</p>';
-
- $body .= '<h4>Vehicle Information</h4>';
- $body .= 'Year: '.$year.'<br />';
- $body .= 'Make: '.$make.'<br />';
- $body .= 'Model: '.$model.'<br />';
- $body .= 'Body Style: '.$bodyStyle.'<br />';
- $body .= 'VIN: '.$vin.'<br />';
- $body .= 'Damaged Glass: '.$damagedGlass.'</p>';
-
- $body .= '<h4>Insurance Information</h4>';
- $body .= 'Ins. Company: '.$insCompany.'<br />';
- $body .= 'Agency: '.$agency.'<br />';
- $body .= 'Policy #'.$policy.'<br />';
- $body .= 'Sent By: '.$sentBy.'<br />';
- $body .= 'Comp Coverage: '.$compCoverage.'<br />';
- $body .= 'Deductible: '.$deductible.'<br />';
- $body .= 'Date of Loss: '.$dateOfLoss.'<br />';
- $body .= 'Cause of Loss: '.$causeOfLoss.'<br />';
- $body .= 'Reply Email: <a href="mailto:'.$replyEmail.'">'.$replyEmail.'</a><br />';
- $body .= 'Special Instructions: '.$specialInstructions.'</p>';
-
-
- //send email and return a message to user
- if(mail($to, $subject, $body, $headers)) {
- $return['error'] = false;
- $return['msg'] =
- '<div class="alert alert-success">'.
- "<h4>Thank you for using our form ".$sentBy ."</h4>".
- "<p>We'll reply to you at ".$email." as soon as we can.</p>";
-
- echo json_encode($return);
- }
- else {
-
- $return['error'] = true;
- $return['msg'] = "<h4>Oops! There was a problem sending the email. Please try again.</h4>";
- echo json_encode($return);
- }
- }
-
- }
- else {
-
- $return['error'] = true;
- $return['msg'] = "<h4>Oops! There was a problem with your submission. Please try again.</h4>";
- echo json_encode($return);
- }
-
- ?>
and the javascript:
Sorry for just linking the javascript, my post was too long
Can anyone see what i am missing? I'm pretty new to javascript and nothing is really jumping out at me. Any insight or help is really appreciated!
Thank you!