{{ if .Site.Data.contact.enable }} | {{ if .Site.Data.contact.enable }} | ||||
{{"<!-- Srart Contact Us -->" | safeHTML}} | |||||
{{"<!-- Start Contact Us -->" | safeHTML}} | |||||
<section id="contact-us" class="contact-us section-bg"> | <section id="contact-us" class="contact-us section-bg"> | ||||
<div class="container"> | <div class="container"> | ||||
<div class="row"> | <div class="row"> | ||||
{{"<!-- Contact Form -->" | safeHTML}} | {{"<!-- Contact Form -->" | safeHTML}} | ||||
<div class="contact-form col-md-6 wow fadeInUp" data-wow-duration="500ms" data-wow-delay="300ms"> | <div class="contact-form col-md-6 wow fadeInUp" data-wow-duration="500ms" data-wow-delay="300ms"> | ||||
<form id="contact-form" method="post" action="sendmail.php" role="form"> | |||||
<form id="contact-form" method="post" action="php/mailer.php" role="form"> | |||||
<div class="form-group"> | <div class="form-group"> | ||||
<input type="text" placeholder="Your Name" class="form-control" name="name" id="name"> | <input type="text" placeholder="Your Name" class="form-control" name="name" id="name"> | ||||
</div> | </div> | ||||
<div class="form-group"> | <div class="form-group"> | ||||
<input type="email" placeholder="Your Email" class="form-control" name="email" id="email"> | |||||
<input type="text" name="email" style="display: none;"> | |||||
<input type="text" placeholder="Your Email" class="form-control" name="email_real" id="email"> | |||||
</div> | </div> | ||||
<div class="form-group"> | <div class="form-group"> | ||||
</section> | </section> | ||||
{{"<!-- /contact -->" | safeHTML}} | {{"<!-- /contact -->" | safeHTML}} | ||||
{{ end }} | |||||
{{ end }} |
{{"<!-- Welcome Slider-->" | safeHTML}} | {{"<!-- Welcome Slider-->" | safeHTML}} | ||||
<section class="hero-area" style='background-image: url("{{ .Site.Params.banner.bgImage | absURL }}");'> | <section class="hero-area" style='background-image: url("{{ .Site.Params.banner.bgImage | absURL }}");'> | ||||
<div class="block"> | <div class="block"> | ||||
<div class="video-button"> | |||||
{{with .Site.Params.banner.icon}} <i class="{{ . }}"></i> {{ end }} | |||||
<div class="logo"> | |||||
<p><img class="logo" src="images/logo.png"></p> | |||||
{{with .Site.Params.banner.icon}} <i class="{{ . }}"></i> {{ end }} video-button | |||||
</div> | </div> | ||||
{{with .Site.Params.banner.heading}} <h1>{{ . }}</h1>{{ end }} | {{with .Site.Params.banner.heading}} <h1>{{ . }}</h1>{{ end }} | ||||
{{with .Site.Params.banner.content}} <p>{{ . }}</p> {{ end }} | {{with .Site.Params.banner.content}} <p>{{ . }}</p> {{ end }} |
to determine if there was an error or not */ | to determine if there was an error or not */ | ||||
var error = false; | var error = false; | ||||
var name = $('#name').val(); | var name = $('#name').val(); | ||||
var email = $('#email').val(); | |||||
var email_real = $('#email_real').val(); | |||||
var subject = $('#subject').val(); | var subject = $('#subject').val(); | ||||
var message = $('#message').val(); | var message = $('#message').val(); | ||||
} | } | ||||
if (email.length == 0 || email.indexOf('@') == '-1') { | if (email.length == 0 || email.indexOf('@') == '-1') { | ||||
var error = true; | var error = true; | ||||
$('#email').css("border-color", "#D8000C"); | |||||
$('#email_real').css("border-color", "#D8000C"); | |||||
} else { | } else { | ||||
$('#email').css("border-color", "#666"); | |||||
$('#email_real').css("border-color", "#666"); | |||||
} | } | ||||
if (subject.length == 0) { | if (subject.length == 0) { | ||||
var error = true; | var error = true; | ||||
/* using the jquery's post(ajax) function and a lifesaver | /* using the jquery's post(ajax) function and a lifesaver | ||||
function serialize() which gets all the data from the form | function serialize() which gets all the data from the form | ||||
we submit it to send_email.php */ | we submit it to send_email.php */ | ||||
$.post("sendmail.php", $("#contact-form").serialize(), function (result) { | |||||
$.post("php/mailer.php", $("#contact-form").serialize(), function (result) { | |||||
//log the result from the script | |||||
console.log(result); | |||||
//and after the ajax request ends we check the text returned | //and after the ajax request ends we check the text returned | ||||
if (result == 'sent') { | if (result == 'sent') { | ||||
//if the mail is sent remove the submit paragraph | //if the mail is sent remove the submit paragraph | ||||
map.setMapTypeId('roadatlas'); | map.setMapTypeId('roadatlas'); | ||||
} | } | ||||
google.maps.event.addDomListener(window, "load", initialize); | |||||
google.maps.event.addDomListener(window, "load", initialize); |