-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmobile-payment.js
More file actions
42 lines (24 loc) · 974 Bytes
/
mobile-payment.js
File metadata and controls
42 lines (24 loc) · 974 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
42
// button section
document.getElementById("login-button").addEventListener('click' , function(event){
event.preventDefault();
console.log("click")
// input section called
const inputsEmail = document.getElementById('Email-input').value;
const inputPasswd = document.getElementById('password-input').value;
console.log(inputsEmail);
console.log(inputPasswd)
// Login information authentication information
// Regex: email can be letters + numbers only
const emailRegex = /^[A-Za-z0-9]+$/;
// Regex: password must be numbers only
const passwordRegex = /^[0-9]+$/;
if (!emailRegex.test(inputsEmail)) {
alert("Make sure you email is right")
} else if (!passwordRegex.test(inputPasswd)){
alert("Make sure you pin is right")
}
else {
alert("✅ Validation passed!");
window.location.href="./Home-page-mobile-payment.html"
}
})