phpBB

Code Changes

File: styles/prosilver/template/ajax.js

  Unmodified   Added   Modified   Removed
Line 335Line 335
			callback: fn
});
}

			callback: fn
});
}

});

// 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);

 
});

/**

});

/**