Forums

Loading JS after verifying Captcha

d4rkbl4de 10 Apr, 2015
Hello!

I was just testing out some fancy JQuery snippets that I implemented in my Joomla. It basically just display a fancy little popup message. I've been using it when the email has been sent inside the On Submit --> Check Captcha --> On Success. It works awesome! The problem is when I put one in the On Submit --> Check Captcha --> On Fail, any JS I put in there seems to be ignored, even a simple console.log('foo');

Do you have any idea what I might be doing wrong?🙂

Thanks!
d4rkbl4de 10 Apr, 2015
Oh. I'm putting those JS snippets inside a Load JavaScript🙂
GreyHead 11 Apr, 2015
Hi d4rkbl4de,

I think that what is happening is that the Success message is shown in a Thank You message in the On Submit event - so it is in the same parent event as your JavaScript.

The Fail box presumably has an Event Loop in it to re-load the On Load event of the form - so your JavaScript there is not in the same event. To show when the form loads it needs to be in the On Load event.

You can set a system message from the On Fail box; I think you could probably set a $form->data variable and check that in the On Load event to show/hide your message but I'm not certain about that.

Bob
This topic is locked and no more replies can be posted.