Untitled
unknown
plain_text
a year ago
649 B
10
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.');
});Editor is loading...
Leave a Comment