I downloaded a template which i have heavily modded, but i have no idea how to implement the contact form, my knowledge on js or ajax is close to nothing.
the js code i found that pertains to the contact is as follows:
//FeedBack Form
jQuery('.content_block').find('.form_field').each(function(){
jQuery(this).width(jQuery(this).parent('form').width()-30);
});
jQuery('.login_form').find('.form_field').each(function(){
jQuery(this).width(jQuery(this).parent('form').width()-30);
});
jQuery('.mc_input').each(function(){
jQuery(this).width(jQuery(this).parents('.widget_mailchimpsf_widget').width()-32);
});
jQuery('.commentlist').find('.stand_comment').each(function(){
set_width = jQuery(this).width() - jQuery(this).find('.commentava').width() - 37;
jQuery(this).find('.thiscommentbody').width(set_width);
});
jQuery('.feedback_go').click(function(){
var par = jQuery(this).parents(".feedback_form");
var name = par.find(".field-name").val();
var email = par.find(".field-email").val();
var message = par.find(".field-message").val();
var subject = par.find(".field-subject").val();
if (email.indexOf('@') < 0) {
email = "mail_error";
}
if (email.indexOf('.') < 0) {
email = "mail_error";
}
jQuery.ajax({
url: "mail.php",
type: "POST",
data: { name: name, email: email, message: message, subject: subject },
success: function(data) {
jQuery('.ajaxanswer').hide().empty().html(data).show("slow");
setTimeout("jQuery('.ajaxanswer').fadeOut('slow')",5000);
}
});
});
The html on contact page is as follows:
<form name="feedback_form" method="post" class="feedback_form">
<input type="text" name="field-name" value="Nombre" title="Name" class="field-name form_field">
<div class="clear"></div>
<input type="text" name="field-email" value="Email" title="Email" class="field-email form_field">
<div class="clear"></div>
<input type="text" name="field-subject" value="Sobre" title="Subject" class="field-subject form_field">
<div class="clear"></div>
<textarea name="field-message" cols="45" rows="5" title="Message" class="field-message form_field">Mensaje</textarea>
<div class="clear"></div>
<input type="reset" name="reset" id="reset2" value="Reiniciar" class="feedback_reset">
<input type="button" name="submit" class="feedback_go" id="submit2" value="Enviar!">
<div class="ajaxanswer"></div>
</form>
How do i cativate this to send emails to my email or do i need mailchimp?? Im completely lost here and been googling with no answer in sight.
Please help!!! :)
thank you.
You need PHP Mailer, that is how the mail.php works. As my site is written in ASP.NET, I've removed the PHP. However the second part of the java script does the post back message, using ajax, which fades in the out with the sucess/failure message. These are also in the PHP mail.php page.