Home › Forums › Porto – Responsive HTML5 Template › Contact Form / White Emails
- This topic has 8 replies, 2 voices, and was last updated 10 years, 5 months ago by
Support. This post has been viewed 1582 times
-
AuthorPosts
-
December 15, 2014 at 5:12 pm #10005630
Pcanales
ParticipantGood afternoon, I have a problem with the contact form, the emails arrive in white. I tried all the forms that are found in the support section of achievement but not correct it. Any suggestions? When I want to add the validators to the .js i syntax error appears. I have many different forms so that you create several contact-form. Could help me ? Thank you very much!
P.D.: If you prefer i can request the password of the host to see the files from the same.
December 15, 2014 at 5:24 pm #10005631Pcanales
ParticipantHTML CODE
<div class=”row”>
<div class=”col-md-12″><div class=”alert alert-success hidden” id=”contactSuccess”>
Consulta enviada con exito! En breve nos pondremos en contacto.
</div><div class=”alert alert-danger hidden” id=”contactError”>
Error! Hubo un error al tratar de enviar el mensaje.
</div>
<h2 class=”short”>Datos del Titular</h2><form id=”contactForm” action=”php/contact-form-productos-autos.php” method=”POST”>
<div class=”row”>
<div class=”form-group”>
<div class=”col-md-6″>
<label>Nombre y Apellido</label>
<input type=”text” value=”” data-msg-required=”Ingresá tu nombre y Apellido.” maxlength=”100″ class=”form-control” name=”name” id=”name” placeholder=”Nombre y Apellido”>
</div>
<div class=”col-md-6″>
<label>E-Mail</label>
<input type=”text” value=”” data-msg-required=”Ingresá tu correo.” maxlength=”100″ class=”form-control” name=”email” id=”email” placeholder=”Correo Electronico”>
</div>
<div class=”col-md-6″>
<label>Tipo de Cliente</label>
<input type=”text” value=”” data-msg-required=”Ingresá si sos Empresa o Particular.” maxlength=”100″ class=”form-control” name=”tipodecliente” id=”tipodecliente” placeholder=”Persona o Empresa”>
</div>
<div class=”col-md-6″>
<label>Número de CUIT/CUIL</label>
<input type=”text” value=”” data-msg-required=”Ingresá tu número de Cuit/Cuil.” maxlength=”100″ class=”form-control” name=”cuit” id=”cuit” placeholder=”Ingresá tu CUIT/CUIL”>
</div>
<div class=”col-md-6″>
<label>Condición de IVA</label>
<input type=”text” value=”” data-msg-required=”Ingresá condición ante el IVA.” maxlength=”100″ class=”form-control” name=”iva” id=”iva” placeholder=”Completá según corresponda”>
</div><div class=”col-md-6″>
<label>Localidad</label>
<input type=”text” value=”” data-msg-required=”Ingresá la Localildad.” maxlength=”100″ class=”form-control” name=”localidad” id=”localidad” placeholder=”Ingresá tu Localidad”>
</div>
<div class=”col-md-6″>
<label>Provincia</label>
<input type=”text” value=”” data-msg-required=”Ingresá la Provincia.” maxlength=”100″ class=”form-control” name=”provincia” id=”provincia” placeholder=”Ingresá la Provincia”>
</div>
<div class=”col-md-6″>
<label>Sexo</label>
<input type=”text” value=”” data-msg-required=”Ingresá tu sexo.” maxlength=”100″ class=”form-control” name=”sexo” id=”sexo” placeholder=”Opcional”>
</div>
<div class=”col-md-6″>
<label>Estado Civil</label>
<input type=”text” value=”” data-msg-required=”Ingresá tu Estado Civil.” maxlength=”100″ class=”form-control” name=”estadocivil” id=”estadocivil” placeholder=”Opcional”>
</div>
<div class=”col-md-6″>
<label>Fecha de Nacimiento</label>
<input type=”text” value=”” data-msg-required=”Ingresá tu fecha de nacimiento.” maxlength=”100″ class=”form-control” name=”nacimiento” id=”nacimiento” placeholder=”Opcional”>
</div></div>
</div><hr class=”tall”>
<div class=”row”>
<div class=”col-md-12″><h2 class=”short”>Datos del Vehiculo </h2>
<div class=”row”>
<div class=”form-group”><div class=”col-md-6″>
<label>Año</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”año” id=”año” placeholder=”Ingresá el Año del Vehiculo”>
</div><div class=”col-md-6″>
<label>Marca</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”marca” id=”marca” placeholder=”Ingresá la Marca”>
</div>
<div class=”col-md-6″>
<label>Modelo</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”modelo” id=”modelo” placeholder=”Ingresá el Modelo”>
</div>
<div class=”col-md-6″>
<label>Versión</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”version” id=”version” placeholder=”Ingresá la versión”>
</div><div class=”col-md-6″>
<label>Tipo</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”tipo” id=”tipo” placeholder=”Ingresá el tipo de Vehiculo”>
</div><div class=”col-md-6″>
<label>Nacionalidad</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”nacionalidad” id=”nacionalidad” placeholder=”Ingresá el origen”>
</div><div class=”col-md-6″>
<label>Uso del Vehiculo</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”uso” id=”uso” placeholder=”Ingresá el uso, Particular o Laboral”>
</div><div class=”col-md-6″>
<label>¿Tiene GNC?</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”gnc” id=”gnc” placeholder=”¿Si o No?”>
</div><div class=”col-md-6″>
<label>Suma GNC</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”sumagnc” id=”sumagnc” placeholder=”¿Tenés pensado agregarle GNC?”>
</div><div class=”col-md-6″>
<label>Rastreo Vehicular</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”rastreo” id=”rastreo” placeholder=”¿Si o No?”>
</div><div class=”col-md-12″>
<label>Medio de pago</label>
<input type=”text” value=”” maxlength=”100″ class=”form-control” name=”mediodepago” id=”mediodepago” placeholder=”Ingresá como te gustaria abonar.”>
</div>
</div>
</div><div class=”row”>
<div class=”col-md-12″>
<input type=”submit” value=”Solicitar Presupuesto” class=”btn btn-primary” data-loading-text=”Enviando…”>
</div>
</div>
</form>
</div>CONTACT-FORM-PRODUCTOS-AUTOS.php
<?php
session_cache_limiter(‘nocache’);
#header(‘Expires: ‘ . gmdate(‘r’, 0));#header(‘Content-type: application/json’);
// Enter your email address below.
$to = ‘[email protected]’;
$subject = $_POST[‘subject’];if ($to) {
require(“php-mailer/class.phpmailer.php”);
$mail = new PHPMailer();
$mail->SMTPAuth = true;
$mail->From = “[email protected]”;
$mail->FromName = “Contacto online”;
$mail->Host = “mail.grupojyp.com.ar”;
$mail->Mailer = “smtp”;
$mail->Username = $mail->From;
$mail->Password = “xxxxxxxx”;
$mail->Subject = $subject;$fields = array(
0 => array(
‘text’ => ‘Nombre’,
‘val’ => $_POST[‘name’]
),
1 => array(
‘text’ => ‘Email’,
‘val’ => $_POST[’email’]
),
2 => array(
‘text’ => ‘Tipo de Cliente’,
‘val’ => $_POST[‘tipodecliente’]
),
3 => array(
‘text’ => ‘Cuit / Cuil’,
‘val’ => $_POST[‘cuit’]
),
4 => array(
‘text’ => ‘Iva’,
‘val’ => $_POST[‘iva’]
),
5 => array(
‘text’ => ‘Localidad’,
‘val’ => $_POST[‘localidad’]
),
6 => array(
‘text’ => ‘Provincia’,
‘val’ => $_POST[‘provincia’]
),
7 => array(
‘text’ => ‘Sexo’,
‘val’ => $_POST[‘sexo’]
),
8 => array(
‘text’ => ‘Estado Civil’,
‘val’ => $_POST[‘estadocivil’]
),
9 => array(
‘text’ => ‘Nacimiento’,
‘val’ => $_POST[‘nacimiento’]
),
10 => array(
‘text’ => ‘Año’,
‘val’ => $_POST[‘año’]
),
11 => array(
‘text’ => ‘Marca’,
‘val’ => $_POST[‘marca’]
),
12 => array(
‘text’ => ‘Modelo’,
‘val’ => $_POST[‘modelo’]
),
13 => array(
‘text’ => ‘Version’,
‘val’ => $_POST[‘version’]
),
14 => array(
‘text’ => ‘Tipo’,
‘val’ => $_POST[‘tipo’]
),
15 => array(
‘text’ => ‘Nacionalidad’,
‘val’ => $_POST[‘nacionalidad’]
),
16 => array(
‘text’ => ‘Uso’,
‘val’ => $_POST[‘uso’]
),
17 => array(
‘text’ => ‘Gnc’,
‘val’ => $_POST[‘gnc’]
),
18 => array(
‘text’ => ‘Suma Gnc’,
‘val’ => $_POST[‘sumagnc’]
),
19 => array(
‘text’ => ‘Rastreo’,
‘val’ => $_POST[‘rastreo’]
),
20 => array(
‘text’ => ‘Medio de Pago’,
‘val’ => $_POST[‘mediodepago’]
)
);$message = “”;
foreach($fields as $field)
$message .= $field[‘text’].”: ” . htmlspecialchars($field[‘val’], ENT_QUOTES) . “<br>\n”;$mail->Body = $message; //cuerpo HTML
$mail->AltBody = str_replace(‘<br />’, ‘\n’, $message); //cuerpo TEXT
$mail->AddAddress($to);
$mail->AddReplyTo($email);if ($mail->Send()){
$arrResult = array (‘response’=>’success’);
} else{
$arrResult = array (‘response’=>’error’);
}echo json_encode($arrResult);
} else {
$arrResult = array (‘response’=>’error’);
echo json_encode($arrResult);}
?>
VIEW.CONTACTS.js
/*
Name: View – Contact
Written by: Okler Themes – (http://www.okler.net)
Version: 3.1.1
*/(function() {
“use strict”;
var Contact = {
initialized: false,
initialize: function() {
if (this.initialized) return;
this.initialized = true;this.build();
this.events();},
build: function() {
// Containers
var map = $(“#googlemaps”),
contactForm = $(“#contactForm”);// Validations Form Type
if(contactForm.get(0)) {if(contactForm.data(“type”) == “advanced”) {
this.advancedValidations();
} else {
this.basicValidations();
}}
},
events: function() {
},
advancedValidations: function() {
var submitButton = $(“#contactFormSubmit”),
contactForm = $(“#contactForm”);submitButton.on(“click”, function() {
if(contactForm.valid()) {
submitButton.button(“loading”);
}
});contactForm.validate({
onkeyup: false,
onclick: false,
onfocusout: false,
rules: {
name: {
required: true
},
email: {
required: true,
email: true
},
subject: {
required: true
},
message: {
required: true
},
captcha: {
required: true,
captcha: true
},
‘checkboxes[]’: {
required: true
}
},
highlight: function (element) {
$(element)
.parent()
.removeClass(“has-success”)
.addClass(“has-error”);
},
success: function (element) {
$(element)
.parent()
.removeClass(“has-error”)
.addClass(“has-success”)
.find(“label.error”)
.remove();
}
});$.validator.addMethod(“captcha”, function () {
var captchaValid = false;
var phpquery = $.ajax({
url: “php/contact-form-verify-captcha.php”,
type: “POST”,
async: false,
dataType: “json”,
data: {
captcha: $.trim($(“#contactForm #captcha”).val())
},
success: function (data) {
if (data.response == “success”) {
captchaValid = true;
} else {}
}
});
if (captchaValid) {
return true;
}
}, “”);},
basicValidations: function() {
var contactform = $(“#contactForm”),
url = contactform.attr(“action”);contactform.validate({
submitHandler: function(form) {// Loading State
var submitButton = $(this.submitButton);
submitButton.button(“loading”);// Ajax Submit
$.ajax({
type: “POST”,
url: url,
data: {
“name”: $(“#contactForm #name”).val(),
“email”: $(“#contactForm #email”).val(),
“subject”: $(“#contactForm #subject”).val(),
“message”: $(“#contactForm #message”).val()
},
dataType: “json”,
success: function (data) {
if (data.response == “success”) {$(“#contactSuccess”).removeClass(“hidden”);
$(“#contactError”).addClass(“hidden”);// Reset Form
$(“#contactForm .form-control”)
.val(“”)
.blur()
.parent()
.removeClass(“has-success”)
.removeClass(“has-error”)
.find(“label.error”)
.remove();if(($(“#contactSuccess”).position().top – 80) < $(window).scrollTop()){
$(“html, body”).animate({
scrollTop: $(“#contactSuccess”).offset().top – 80
}, 300);
}} else {
$(“#contactError”).removeClass(“hidden”);
$(“#contactSuccess”).addClass(“hidden”);if(($(“#contactError”).position().top – 80) < $(window).scrollTop()){
$(“html, body”).animate({
scrollTop: $(“#contactError”).offset().top – 80
}, 300);
}}
},
complete: function () {
submitButton.button(“reset”);
}
});
},
rules: {
name: {
required: true
},
email: {
required: true,
email: true
},
subject: {
required: true
},
message: {
required: true
}
},
highlight: function (element) {
$(element)
.parent()
.removeClass(“has-success”)
.addClass(“has-error”);
},
success: function (element) {
$(element)
.parent()
.removeClass(“has-error”)
.addClass(“has-success”)
.find(“label.error”)
.remove();
}
});}
};
Contact.initialize();
})();
I have 1 php for each Contact Form (each one has different data, it is necessary to create several view.contacts.js.) Thanks again and I want to thank you for the excellent support and templates that make it.
December 16, 2014 at 9:50 am #10005642Support
KeymasterHello, looks like there’s a problem in the JS file (js/views/view.contact.js) as you can see here in the browsers console, it’s missing a “,”:
Please try to fix that and let me know if you need further assistance.
Kind Regards, Jonas
December 16, 2014 at 11:10 am #10005647Pcanales
ParticipantGood morning, thank you for your response, but in that place i lack , ? On the other hand my problem is that I arrive the mails with the form, but only the fields, name and e-mail addresses are those who have information, the other in white. Could tell me how to i get well emails? Greetings and thank you very much!
December 16, 2014 at 12:06 pm #10005648Support
KeymasterHello, yes, that may be the problem with the data not being sent to the email. Can you please add the “,” and test is again?
December 16, 2014 at 12:30 pm #10005651Pcanales
ParticipantSorry, but I don’t know where to put that ” ,” can show me where?
December 16, 2014 at 3:58 pm #10005663Support
KeymasterOops, my bad, really sorry, my reply was missing the screenshot:
Sorry about that.
Please try that and let me know if you need further assistance.
Kind Regards, Jonas
December 16, 2014 at 6:15 pm #10005673Pcanales
ParticipantThank you for your help! And thank you for having purchased the template to you. The forms are perfect now! I am very happy! Finally, and I promise not to disturb them already, I need that on the page that attachment, when I click on the items in the left margin i redirect to the appropriate sector, it is easy to understand what I want to explain? Screenshoot for a Deputy that I understand a little better.
Try to put the Id code but i was not. Now and again many thanks from Argentina!
December 17, 2014 at 9:21 am #10005677Support
KeymasterHello, I’m sorry but I don’t understand the question, can you send a screenshot from what you mean? Thanks.
-
AuthorPosts
This topic is marked as "RESOLVED" and can not rceive new replies.