Execute JavaScript after Submit

wayne.regehr 28 May, 2014
I have a contact form that is displayed via a module, but becomes slightly lost on pages where it is displayed. (multiple modules, etc)

After a user submits the form, I have a Thank You message generated as a button that when clicked, launches a modal window. This is working just fine. However, the button to launch the modal window appears with the form, and may not be obvious to users that the form was submitted correctly.

I would like to add a small JS snippet to 'click' (activate) my modal Thank You message, after the submit button has been clicked.

I have a Custom PHP code block being executed in the "After Emails Code" section. This generates my Thank You button and the modal window it outputs.

What is the correct way to implement the javascript, to execute after the submit button, along with my Custom PHP code?

I have been working on this for a while with no success. Any JS that I place in the "JavaScript Code" section is always executed when the form is first displayed and had not effect after the submit button.

Any tips or pointers would be greatly appreciated.
wayne.regehr 28 May, 2014
Answer
After further testing, I found that I could execute JS from within the Custom PHP code successfully. It seems I might have a syntax issue with my JS. Consider this topic closed.
Max_admin 02 Jun, 2014
Hi Wayne,

Great, you can simply place any JS code inside a "Load JS" action in the "on submit" event, that would run the JS code in the pag displayed after the form is submitted!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.