Happy day Softr Community! Here’s what I’d like to do:
- User fills out form and submits
- Do some extra error checking in javascript
- If data is fine, continue submitting
- If data isn’t, send an alert message
I saw this to catch the submit event
<script>
window.addEventListener('submit-form-form1', (e) => {
// e.detail is an object with form field names and values
console.log('form submit', e.detail);
// form submit { "Full Name": "Softr", "Email": "info@softr.io" }
});
</script>
but I have no idea how to prevent it from submitting. I tried
e.preventDefault();
but that didn’t work. Any ideas?