The Code Given is for only beginners in HTML
1.The code implements a simple login form
2.It checks whether the password and usernames are matching or not
3.While you are using replace the predefined username and password that I'v given
that is replace "myuserid" and "mypswrd" with your own userid and password.
4.just copy the file and paste it in the notepad.
5.and save it with an extension of .html or .htm
6.select 'All Files' from the popupmenu shown at the bottom of notepad before saving.
7.Now you will get a document that has the symbol of internet explorer.
8.just open that file and if the computer ask for script activation press ok.
9.Now run your page
10.You can customize the page by applying CSS.
Try it....
It's Your friend,,,
Rajeesh.N.Santhu
A Simple HTML Login page using JavaScript
iConqueror
commented:
good stuff
+0
almostbob
commented:
if BS were music this would be mozart's 40 in G
-3
<html>
<head>
<title>
Login page
</title>
</head>
<body>
<h1 style="font-family:Comic Sans Ms;text-align="center";font-size:20pt;
color:#00FF00;>
Simple Login Page
</h1>
<form name="login">
Username<input type="text" name="userid"/>
Password<input type="password" name="pswrd"/>
<input type="button" onclick="check(this.form)" value="Login"/>
<input type="reset" value="Cancel"/>
</form>
<script language="javascript">
function check(form)/*function to check userid & password*/
{
/*the following code checkes whether the entered userid and password are matching*/
if(form.userid.value == "myuserid" && form.pswrd.value == "mypswrd")
{
window.open('target.html')/*opens the target page while Id & password matches*/
}
else
{
alert("Error Password or Username")/*displays error message*/
}
}
</script>
</body>
</html>
sachin bhosale
0
Newbie Poster
rmlalchan
0
Newbie Poster
yeminhtet
0
Newbie Poster
riahc3
50
Â
Team Colleague
vgkarthi
0
Newbie Poster
F-3000
0
Newbie Poster
MidiMagic
579
Nearly a Senior Poster
F-3000
commented:
A point I should have mentioned in my reply.
+0
dados
0
Newbie Poster
jtutuncumacias
0
Newbie Poster
Andrew_5
0
Newbie Poster
topdude155
0
Newbie Poster
harpriya.gill.7
0
Newbie Poster
Sud4U
0
Newbie Poster
almostbob
866
Retired: passive income ROCKS
JorgeM
commented:
garbage is exactly what i was thinking. This example shouldnt even be used for testing purposes. People...do not create login forms with a javascript authentication scheme. No!
+12
mattster
195
Practically a Master Poster
Featured Poster
piers
8
Junior Poster in Training
diafol
AlvinV
0
Newbie Poster
DistantGalaxy
15
Newbie Poster
satya keerthi
0
Newbie Poster
Zayne
commented:
js can be used for this if only its used in electron its a bit more safe
+0
gentlemedia
803
Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.