• I have a cForms II contact form set up. It works perfectly if I just want the results emailed to myself (default behavior).

    I now have a custom PHP file that will take the POST data from the form and submit it to an external database for me. However, when I set the Alternative Form Action page to this PHP page, clicking the Submit button just causes the form to hang.

    How exactly do I pass the form data to my own PHP file while still keeping AJAX enabled (so form validation works)?

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter thinkswan

    (@thinkswan)

    Ah, I figured it out!

    To do post-processing, you don’t redirect the form submission to your own file.

    You simply modify the my_cforms_ajax_filter($params) function in the my-functions.php file (in your cForms directory).

    This function is executed after form validation and before any data processing takes place (so you can intercept the form data).

    Just what I was looking for!

    Would you mind just specifying the modifications that need to be made to the function to enable submission to an external database, please?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: cformsII – contact form] How to do your own post-processing using AJAX’ is closed to new replies.