getgrav / grav-plugin-email

Grav Email Plugin
http://getgrav.org
MIT License
37 stars 29 forks source link

is it possible to integrate ajax form submission on this plugin? #42

Closed rlynjb closed 8 years ago

rlynjb commented 8 years ago

Hi, I am working on a form plugin. Im a newbie with php as well. I was wondering if we can hook an ajax script to avoid refreshing the page that contains contact form. What I do so far is defined fields on a .md file but to avoid refreshing the page, Im planning on using ajax to send data to process hook.. is this possible?

Thank you

flaviocopes commented 8 years ago

It's surely possible. If you intercept the submit event on a form and submit it using AJAX it's going to be processed in the same way a "normal" submit event works.

You then need to care about the return value and update the page accordingly.

flaviocopes commented 8 years ago

Closing as it's not really an issue of the email plugin

rlynjb commented 8 years ago

thank you @flaviocopes it works!! :-)