...
...
...
const handleRegistration = (event) => {
event.preventDefault();
const username = getValue("username");
const first_name = getValue("first_name");
const last_name = getValue("last_name");
const email = getValue("email");
const password = getValue("password");
const confirm_password = getValue("confirm_password");
const info = {
username,
first_name,
last_name,
email,
password,
confirm_password,
};
if (password === confirm_password) {
document.getElementById("error").innerText = "";
if (
/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/.test(
password
)
) {
console.log(info);
fetch("https://testing-8az5.onrender.com/patient/register/", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(info),
})
.then((res) => res.json())
.then((data) => console.log(data));
} else {
document.getElementById("error").innerText =
"pass must contain eight characters, at least one letter, one number and one special character:";
}
} else {
document.getElementById("error").innerText =
"password and confirm password do not match";
alert("password and confirm password do not match");
}
};
...
...
...
এখন , password ও confirm_password ফিল্ডে সেইম ইনপুট না দিলে ইরোর মেসেজ পাওয়া যাচ্ছে-
.