The gform_confirmation_loaded Gravity Forms JavaScript event fires when the confirmation message is displayed on AJAX-enabled forms.
Usage
<script type="text/javascript">
jQuery(document).on('gform_confirmation_loaded', function(event, formId) {
// your custom code here
});
</script>
Parameters
- event: JS Object | object – The Javascript event object.
- formId: integer – The ID of the form submitted.
More information
See Gravity Forms Docs: gform_confirmation_loaded
Examples
Refresh Cufon font substitution
Refresh the Cufon font substitution when the confirmation page is loaded.
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(document).on('gform_confirmation_loaded', function() {
Cufon.refresh('h1,h2,h3,h4,h5,h6');
});
});
</script>
Run different code for different form IDs
Run different code depending on which form’s confirmation is being loaded.
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(document).on('gform_confirmation_loaded', function(event, formId) {
if (formId == 1) {
// run code specific to form ID 1
} else if (formId == 2) {
// run code specific to form ID 2
}
});
});
</script>