Help: reCaptcha not calling OnVerified()

I added a reCaptcha element to my page, and added the OnVerified event to my page (frontend) code.

export function captcha1_verified() {
    console.log("Captcha Verified");
}

however, this console log is never called, even when I get the green checkmark on the captcha.

Any Ideas? (The page has not yet been published).

Can you please remove this code and add again from the panel again? Sometimes it become disconnected when undo is clicked.

More stable way is to set the event via code like

$w(‘#captcha1’).onVerified(()=>{

})

I saw this method before but for whatever reason I get an error and it wont let me implement it this way. I’ve tried removing the event and re-adding it multiple times.

You have to return at the end of the code.

Put this INSIDE of the event:

return Promise.resolve(true) // or false

@certified-code

so the return allowed that code, I couldn’t put a boolean in the parameters, but that is fine. The issue is it still isn’t getting called even when I pass the captcha.

Code:

$w('#captcha1').onVerified(()=>{

    console.log("TEST");
 return Promise.resolve();
})

the console.log(“TEST”); is never called even when captcha is verified.

If possible, can you post your page URL?

@certified-code the page has yet to be published, I wasn’t going to publish the page until the code was done.

Issue still occurring, if anyone has any ideas. Perhaps it won’t work unless the page is published? I’m not sure. But without being able to properly test it I can’t implement it.