mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-23 10:01:55 +02:00
Merge pull request #6680 from marc1706/ticket/17366
[ticket/17366] Resolve issues with form submissions and recaptcha
This commit is contained in:
@@ -359,6 +359,7 @@ class recaptcha_v3 extends captcha_abstract
|
||||
if ($result->isSuccess())
|
||||
{
|
||||
$this->solved = true;
|
||||
$this->confirm_code = $this->code;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -337,30 +337,6 @@ $('[data-ajax]').each(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// Prevent accidental double submission of form
|
||||
$('[data-prevent-flood] input[type=submit]').click(function(event) {
|
||||
const $submitButton = $(this); // Store the button element
|
||||
const $form = $submitButton.closest('form');
|
||||
|
||||
// Always add the disabled class for visual feedback
|
||||
$submitButton.addClass('disabled');
|
||||
|
||||
// Submit form if it hasn't been submitted yet
|
||||
if (!$form.prop('data-form-submitted')) {
|
||||
$form.prop('data-form-submitted', true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent default submission for subsequent clicks within 5 seconds
|
||||
event.preventDefault();
|
||||
|
||||
setTimeout(() => {
|
||||
$form.prop('removeProp', 'data-form-submitted');
|
||||
$submitButton.removeClass('disabled'); // Re-enable after 5 seconds
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
/**
|
||||
* This simply appends #preview to the action of the
|
||||
* QR action when you click the Full Editor & Preview button
|
||||
|
@@ -100,7 +100,7 @@
|
||||
<!-- IF not S_SHOW_DRAFTS and not $SIG_EDIT eq 1 -->
|
||||
<div class="panel bg2">
|
||||
<div class="inner">
|
||||
<fieldset class="submit-buttons" data-prevent-flood>
|
||||
<fieldset class="submit-buttons">
|
||||
{S_HIDDEN_ADDRESS_FIELD}
|
||||
{S_HIDDEN_FIELDS}
|
||||
<!-- EVENT posting_editor_submit_buttons -->
|
||||
|
Reference in New Issue
Block a user