-
Notifications
You must be signed in to change notification settings - Fork 0
/
script1.js
34 lines (34 loc) · 896 Bytes
/
script1.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
31
32
33
34
function login()
{
var uname = document.getElementById("email").value;
var pwd = document.getElementById("pwd1").value;
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if(uname =='')
{
alert("please enter user name.");
}
else if(pwd=='')
{
alert("enter the password");
}
else if(!filter.test(uname))
{
alert("Enter valid email id.");
}
else if(pwd.length < 6 || pwd.length > 6)
{
alert("Password min and max length is 6.");
}
else
{
alert('Thank You for Login & You are Redirecting to Secured page');
//Redirecting to other page or webste code or you can set your own html page.
window.location = "securedpage.html";
}
}
//Reset Inputfield code.
function clearFunc()
{
document.getElementById("email").value="";
document.getElementById("pwd1").value="";
}