Skip to content

Commit

Permalink
save send button in a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
fellyph committed Mar 12, 2024
1 parent 9ab4553 commit 0510eba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/scenarios/google-recaptcha/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
<script type="text/javascript">
const statusMessage = document.getElementById('status-message');
const captchaForm = document.getElementById('captcha-form');
const sendButton = captchaForm.querySelector('input[type="submit"]')
const verifyCallback = (response) => {
console.log(response);
if (response) {
statusMessage.textContent = `captcha verified`;
captchaForm.querySelector('input[type="submit"]').removeAttribute('disabled');
captchaForm.querySelector('input[type="submit"]').classList.remove('cursor-not-allowed');
captchaForm.querySelector('input[type="submit"]').classList.remove('bg-gray-100');
captchaForm.querySelector('input[type="submit"]').classList.add('bg-blue-500');
sendButton.removeAttribute('disabled');
sendButton.classList.remove('cursor-not-allowed');
sendButton.classList.remove('bg-gray-100');
sendButton.classList.add('bg-blue-500');
}
};
Expand Down

0 comments on commit 0510eba

Please sign in to comment.