Skip to content

Commit

Permalink
Merge pull request #66 from rtCamp/feature/recaptcha-google-main
Browse files Browse the repository at this point in the history
Update messaging in reCaptcha demo
  • Loading branch information
gagan0123 authored Apr 18, 2024
2 parents 1361a41 + 353c304 commit ea933a7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/scenarios/google-recaptcha/index.ejs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<%- include(commonPath + '/header.ejs') %>

<%- include(commonPath + '/internal-page/header.ejs', {containerType: 'sm'}) %>
<div id="status-message" class="text-center font-bold text-lg my-4"></div>
<div id="status-message" class="text-center font-bold text-lg my-4"></div>
<form action="?" method="POST" id="captcha-form" class="flex justify-between" >
<div id="html_element"></div>
<input
type="submit"
value="Send"
disabled
<input
type="submit"
value="Send"
disabled
class="px-4 py-2 bg-gray-100 text-white rounded transition duration-300 cursor-not-allowed" />
</form>
<%- include(commonPath + '/internal-page/footer.ejs') %>
Expand All @@ -30,14 +30,14 @@
const errorCallback = (error) => {
console.log('error');
if (error) {
statusMessage.textContent = `captcha error`;
statusMessage.textContent = `reCaptcha error!`;
}
};
captchaForm.onsubmit = (event) => {
event.preventDefault();
const token = grecaptcha.getResponse();
statusMessage.textContent = `form submitted, captcha token ${token}`;
statusMessage.textContent = `Form submitted successfully!`;
}
window.onloadCallback = function() {
Expand Down

0 comments on commit ea933a7

Please sign in to comment.