১৯-১ : রেজিসট্রেশন
এই মডিউলে দেখব রেজিস্ট্রেশন ফর্মের ডেটা কিভাবে js ফাইলে পাওয়া যায় ও প্রসেস করা যায়।
auth.js ফাইলে ক্রিয়েট করে নিচের মত করে লিখে ফেলি-
Code:: 19.1.1 auth.js
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,
};
console.log({
username,
first_name,
last_name,
email,
password,
confirm_password});
};
const getValue = (id) => {
const value = document.getElementById(id).value;
return value;
};
Registration পেজটি নিচের মত করে পূরন করে পেজটি inspect করলে দেখা যাবে ফর্মের ডেটা colsole.log() হয়েছে -


.
Previousমডিউল ১৯ঃ হসপিটাল ম্যানেজমেন্ট ফ্রন্ট-এন্ড, পার্ট-৩Next১৯-২ : regex ব্যবহার করে পাসওয়ার্ড ভ্যালিডেশন
Last updated