I've got a gravity form that I'm bringing into my wordpress site with no issues so long as I don't mind using the standard response in the backend.
I'm pulling it in using the following shortcode and that works fine:
<?php echo do_shortcode('[gravityform id="2" title="true" ajax="true"]'); ?>
What I'd like to do is to be able to use a custom success message. Not the stuff in their back end on the form. I mean on ajax form submit, I want to be able to be able to set a part of the page visible that wasn't visible before but I'm not sure how to trigger that through JavaScript.
I used a form.submit() function but that only tells me the form is being submitted, it doesn't tell me if the post was successful.
Does anyone know how I can query whether the post was successful?
I hope that makes sense.
Many thanks
I managed to find the answer to my question after a lot of googling.
jQuery(document).on('gform_confirmation_loaded', function(event, formId){
// code to be trigger when confirmation page is loaded
});
This allows me to trigger my function once the confirmation message is returned.