show submit button on captcha success

Signed-off-by: Odyssey346 <odyssey346@disroot.org>
This commit is contained in:
Odyssey346 2022-07-29 12:42:26 +02:00
parent 7ec4268a49
commit 8b0299b758

View File

@ -6,7 +6,14 @@ description: Do you want to contact us?
<script lang="ts"> <script lang="ts">
import IconLock from '~icons/fa6-solid/lock'; import IconLock from '~icons/fa6-solid/lock';
import IconInfo from '~icons/fa6-solid/circle-info';
import HCaptcha from 'svelte-hcaptcha'; import HCaptcha from 'svelte-hcaptcha';
let contactform;
let submit = false;
function showSubmitButton() {
submit = !submit;
}
</script> </script>
@ -15,7 +22,7 @@ description: Do you want to contact us?
{ description } { description }
## Contact Form ## Contact Form
<form action="https://segfautilities.projectsegfau.lt/api/form" method="POST"> <form action="https://segfautilities.projectsegfau.lt/api/form" method="POST" id="contact-form" bind:this={contactform}>
<div class="ip-note"> <div class="ip-note">
<IconLock /> <IconLock />
<b>Your IP will be logged for anti-abuse measures.</b> <b>Your IP will be logged for anti-abuse measures.</b>
@ -31,11 +38,18 @@ description: Do you want to contact us?
</select> </select>
</div> </div>
<textarea id="comment" name="message" rows="4" cols="25" required="required" class="form-textbox" placeholder="Your message"></textarea> <textarea id="comment" name="message" rows="4" cols="25" required="required" class="form-textbox" placeholder="Your message"></textarea>
<div class="ip-info">
<IconInfo />
<b>The submit button will be visible when you complete the captcha.</b>
</div>
<HCaptcha <HCaptcha
sitekey=67e84266-980c-4050-8a39-142a91928fe8 sitekey=67e84266-980c-4050-8a39-142a91928fe8
theme=dark theme=dark
on:success={showSubmitButton}
/> />
<input type="submit" value="Submit" class="button" /> {#if submit}
<input type="submit" value="Submit" class="button" />
{/if}
</form> </form>
## Our email ## Our email