Form Webhook Handler JS API Events

SA5 Forms supports two events.

Event
Fires

formSubmitSuccess

When a form is submitted and the called webhook responds successfully ( HTTP response 200 - 299 ).

formSubmitFail

When a form is submitted and the called webhook responds successfully ( HTTP response 400 - 599 ).

Form Submit Success Event

When a form is submitted and the called webhook responds successfully ( HTTP response 200 - 299 ).

  • form - is the SA5 Form object

  • data - is any JSON data returned by the webhook

<!-- Sygnal Attributes 5 | Forms | Form Submit Success Event -->
<script>
window.sa5 = window.sa5 || [];
window.sa5.push(['formSubmitSuccess', 
  (form, data) => {

    // Perform any actions 

    return;
  }]); 
</script>

Form Submit Fail Event

When a form is submitted and the called webhook responds successfully ( HTTP response 400 - 599 ).

  • form - is the SA5 Form object

  • data - is any JSON data returned by the webhook

<!-- Sygnal Attributes 5 | Forms | Form Submit Fail Event -->
<script>
window.sa5 = window.sa5 || [];
window.sa5.push(['formSubmitFail', 
  (form, data) => {
  
    // Perform any actions 

    return;
  }]); 
</script>

Last updated

Was this helpful?