Hello!
I’m having issue of receving form messages on netlify after i embed the Recaptcha into my code! Can you guys please check my code? what’s wrong here!
<form
class="form__inputs flex flex--d--c"
data-netlify="true"
method="POST"
data-netlify-recaptcha="true"
>
<input
spellcheck="false"
type="text"
placeholder="Enter your name"
name="name"
required
/>
<input
spellcheck="false"
type="email"
placeholder="Enter your email"
name="email"
required
/>
<textarea
spellcheck="false"
placeholder="How can i help you?"
name="messsage"
cols="30"
rows="10"
name="messsage"
required
></textarea>
<div
class="g-recaptcha recap"
data-sitekey="6LcRvdEZAAAAAPEZuA2nuDpg43qzozqg87iQ_M4g"
></div>
<button class="form__cta cta" type="submit">Submit</button>
</form>
$(".form__inputs").submit(function (e) {
e.preventDefault();
var $form = $(this);
$.post($form.attr("action"), $form.serialize()).then(function () {
var recap = $("#g-recaptcha-response").val();
if (recap == "") {
alert("Prove that you are not a robot!");
} else {
$("form").hide();
$(".done").delay(1000).show();
}
});
});