-
Lukas Ruge authoredLukas Ruge authored
site-form.html 1.45 KiB
<div class="form form--contact">
<form class="contact-form" action="" method="POST">
<label class="label" for="name">Name: <span class="required">*</span></label>
<input class="input" id="name" type="text" name="name" value="" placeholder="Your Name" required="required" />
<label class="label" for="_replyto">Email Address: <span class="required">*</span></label>
<input class="input" id="_replyto" type="email" name="_replyto" value="" placeholder="email@website.com" required="required" />
<label class="label" for="message">Message: <span class="required">*</span></label>
<textarea class="textarea" id="message" name="message" placeholder="Your message..." required="required"></textarea>
<input class="button" type="submit" value="Send message" />
<br/>
<small class="small"><span class="required">*</span> indicates a required field</small>
<input type="text" name="_gotcha" style="display:none">
<input type="hidden" name="_subject" value="Message from {{ site.name }} website">
<input type="hidden" name="_next" value="/thanks/" />
</form>
</div>
<script>
var email = "{{ site.email | split: "" | reverse | join: "" }}";
var unraveledEmail = email.split("").reverse().join("");
var form = document.querySelector(".contact-form");
form.setAttribute("action", "https://formspree.io/" + unraveledEmail);
</script>
<noscript>Please enable JavaScript to use the form.</noscript>