-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript3.js
More file actions
21 lines (18 loc) · 897 Bytes
/
script3.js
File metadata and controls
21 lines (18 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const nameInput = document.getElementById ("nameInput");
const emailInput = document.getElementById ("emailInput");
const passwordInput = document.getElementById ("passwordInput");
const adressInput = document.getElementById ("addressInput");
const phoneInput = document.getElementById ("phoneInput");
const ageInput = document.getElementById ("ageInput");
async function signup() {
const apiUrl = `https://tatbeqak.site/apps/tatbeqey/apps/projects/test_api/signup?name=${nameInput.value}&email=${emailInput.value}&password=${passwordInput.value}&address=${adressInput.value}&phone=${phoneInput.value}&age=${ageInput.value}`;
const responce = await fetch (apiUrl);
const data = await responce.json();
const status = data.status;
if (status == true) {
alert ("Signed up successfully");
location.reload();
} else {
alert("sign up failed");
}
}