Last active
July 20, 2020 11:38
-
-
Save logemann/4ab1f61d384fa0ad4c4f185926ec90cf to your computer and use it in GitHub Desktop.
example code for: https://medium.com/aws-factory/recaptcha-form-with-an-amazon-aws-backend-based-on-cdk-78377db58d1f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://www.google.com/recaptcha/api.js"></script> | |
<script src="https://code.jquery.com/jquery-3.5.1.min.js" | |
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" | |
crossorigin="anonymous"> | |
</script> | |
<script> | |
function onSubmit(token) { | |
$("#ContactForm").prop("action", "https://api.mydomain.com/cform"); | |
document.getElementById("ContactForm").submit(); | |
} | |
</script> | |
</head> | |
<body> | |
<form name="contact-form" id="ContactForm" method="post" action="#"> | |
<div class="row"> | |
<div class="col-md-6"> | |
<label for="InputName">Name*</label> | |
<input type="text" class="form-control" id="InputName" name="FULLNAME"> | |
</div> | |
<div class="col-md-6"> | |
<div class="form-group"> | |
<label for="InputEmail"Email*</label> | |
<input type="email" class="form-control" id="InputEmail" name="EMAIL"> | |
</div> | |
</div> | |
<div class="col-md-6"> | |
<label for="InputMobile">Phone</label> | |
<input type="text" class="form-control" id="InputMobile" name="PHONE"> | |
</div> | |
<div class="col-md-6"> | |
<div class="form-group"> | |
<label for="InputSubject">Subject*</label> | |
<input type="text" class="form-control" id="InputSubject" name="SUBJECT"> | |
</div> | |
</div> | |
<div class="col-md-12"> | |
<div class="form-group"> | |
<label for="InputMessage">Message*</label> | |
<textarea class="form-control" id="InputMessage" name="MESSAGE"></textarea> | |
</div> | |
</div> | |
<div class="col-md-12 text-center"> | |
<button class="g-recaptcha btn btn-theme-primary" | |
data-sitekey="yyyyyyyyyyyyyyyyyyyyyy" | |
data-callback='onSubmit' | |
data-action='submit'>Submit</button> | |
</div> | |
</div> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment