This example demonstrates how to use Procaptcha in invisible image mode with implicit rendering directly on a button.
This demo shows how to implement invisible image CAPTCHA directly on a button using implicit rendering:
procaptcha
class to your submit buttondata-sitekey
with your image site keydata-callback
to the function that will receive the tokendata-captcha-type="image"
to specify the typedata-size="invisible"
to enable invisible mode<button class="mui-btn mui-btn--raised procaptcha" data-sitekey="%PROSOPO_SITE_KEY_image%" data-callback="onActionHandler" data-failed-callback="onCaptchaFailed" data-captcha-type="image" data-size="invisible"> Submit </button>
procaptcha
classprocaptcha:execute
eventdata-callback
function is called with the tokenWhen the button is clicked, these internal steps happen:
data-size="invisible"
procaptcha-container
)p-procaptcha
procaptcha:execute
event with container detailsImportant: Callback functions must be defined directly on the window object, not inside event listeners or other closures, so they're accessible when the CAPTCHA system initializes.
window.onActionHandler = function(token) { console.log('Procaptcha token received:', token); // Handle form submission with the token };