Hello, i buy website template with scripts for email sending, but it doesn't work together with couchCMS.
Please, help.
- Code: Select all
<div id="message-info"></div>
<cms:form method="post" id="contactform" anchor='1' action="">
<div class="col-sm-12">
<cms:input type="text" name="name" id="name" placeholder="Vaše jméno a příjmení *" />
</div>
<div class="col-sm-6">
<cms:input type="email" name="email" id="email" placeholder="Váš e-mailová adresa *" />
</div>
<div class="col-sm-6">
<cms:input type="text" name="phone" id="phone" placeholder="Váše telefonní číslo"/>
</div>
<div class="col-sm-12">
<cms:input type="textarea" name="message" rows="9" id="message" placeholder="Vaše zpráva *" />
</div>
<div class="col-sm-12 checkbox">
<cms:input name="gdpr" opt_values="Souhlasím se zpracováním osobních údajů" type='checkbox' />
</div>
<cms:if k_success >
<cms:send_mail from=k_email_from to=k_email_to subject='Vyplněný formulář z webu'>
<!doctype html>
<html>
<body>
<p style="font-size:large;">
Kontaktní formulář:<br/><br/>
<strong>Jméno a příjmení:</strong> <cms:show frm_name/><br/>
<strong>E-mail:</strong> <cms:show frm_email/><br/>
<strong>Telefonní číslo:</strong> <cms:show frm_phone/><br/>
<strong>Zpráva:</strong><br/>
<cms:nl2br><cms:show frm_message/></cms:nl2br><br/>
<strong>Souhlas se zpracováním osobních údajů.</strong> Ano<br/>
</p>
</body>
</html>
</cms:send_mail>
</cms:if>
<div class="col-md-12">
<cms:input type="submit" name="submit" class="submit btn btn-lg btn-primary" id="submit" value="Odeslat zprávu"/>
</div>
</cms:form>
- Code: Select all
function contactForm() {
$('#contactform').submit(function () {
var action = 'contact.php';
$("#message-info").slideUp(250, function () {
$('#message-info').hide();
$('#submit')
.after('<div class="loader"><div></div></div>')
.attr('disabled', 'disabled');
$.post(action, {
name: $('#name').val(),
email: $('#email').val(),
phone: $('#phone').val(),
message: $('#message').val()
},
function (data) {
document.getElementById('message-info').innerHTML = data;
$('#message-info').slideDown(250);
$('#contactform .loader div').fadeOut('slow', function() {
$(this).remove();
});
$('#submit').removeAttr('disabled');
if (data.match('success') !== null) {
$('#contactform').slideUp(850, 'easeInOutExpo');
}
});
});
return false;
});
}
Please, help.