Define window.fseCallbacks before the formseal script tag to hook into form events.
<script>
window.fseCallbacks = {
onSuccess: function(response) {
// response = your endpoint's JSON response
},
onError: function(error) {
// error = Error object
}
};
</script>
<script src="/formseal-embed/globals.js"></script>onSuccess fires after a successful POST. onError fires on network failure — not on validation errors, which are handled inline.
If you want full control over messaging, set status: null and handle everything in callbacks:
var FSE = {
status: null,
};| Event | Trigger | onError called? |
|---|---|---|
| Validation failure | Missing or invalid field | No |
| Network error | POST fails | Yes |
| Success | POST returns 2xx | No — use onSuccess |