Untitled

mail@pastecode.io avatar
unknown
plain_text
4 months ago
649 B
2
Indexable
const form = event.target;

            // Send the form data using fetch
            fetch(form.action, {
                method: 'POST',
                body: new FormData(form)
            }).then(function(response) {
                if (response.ok) {
                    // Clear the form if the submission was successful
                    form.reset();
                    alert('Registration successful!');
                } else {
                    alert('There was an error submitting the form.');
                }
            }).catch(function(error) {
                alert('There was an error submitting the form.');
            });
Leave a Comment