I found this code snippet on a website and I'm trying to figure out how to make the 'Send!' button redirect users to my email address with their message, name, and email included. Can anyone help me solve this issue?
I attempted to add my email to the Send button but it just refreshes the form. Any assistance would be greatly appreciated!
body {
padding-top: 25px;
background-color: #454545;
margin-left: 10px;
margin-right: 10px;
}
.container {
max-width: 600px;
margin: 0 auto;
text-align: center;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
background-color: #FAFAFA;
}
...
<br/>
<br />
<br />
<script>
// When the browser is ready...
$(function() {
// validate
$("#contact").validate({
// Set the validation rules
rules: {
name: "required",
email: {
required: true,
email: true
},
message: "required",
},
// Specify the validation error messages
messages: {
name: "Please enter your name",
email: "Please enter a valid email address",
message: "Please enter a message",
},
// submit handler
submitHandler: function(form) {
//form.submit();
$(".message").show();
$(".message").fadeOut(4500);
}
});
});
</script>
<!--
contact form created for treehouse competition.
-->
<form id="contact">
<div class="container">
<div class="head">
<h2>Say Hello</h2>
</div>
<input type="text" name="name" placeholder="Name" /><br />
<input type="email" name="email" placeholder="Email" /><br />
<textarea type="text" name="message" placeholder="Message"></textarea><br />
<div class="message">Message Sent</div>
<a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e98186858d8c879b8c8b8c8a8a88c7dbdda98e84888085c78a8684">[email protected]</a>" target="_blank">
<button id="submit" type="submit">
Send!
</button>
</a>
</div>
</form>