-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
30 lines (26 loc) · 952 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const registrationForm = document.getElementById('registrationForm');
registrationForm.addEventListener('submit', (event) => {
event.preventDefault();
const formData = new FormData(registrationForm);
const vendorName = formData.get('vendorName');
const vendorEmail = formData.get('vendorEmail');
const vendorPhone = formData.get('vendorPhone');
const vendorAddress = formData.get('vendorAddress');
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
vendorName: vendorName,
vendorEmail: vendorEmail,
vendorPhone: vendorPhone,
vendorAddress: vendorAddress,
})
};
// fetch('https://example.com/api/vendors', requestOptions)
// .then(response => response.json())
// .then(data => {
// alert('Registration Successful!');
// registrationForm.reset();
// })
// .catch(error => console.error(error));
// });