473,473 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

password validation

i am relatively new to javascript
i am trying for a password validation code
but iam not able to stop the page from loading the page when the
password is wrong. the code is as below
------------------
<html>
<head>
<title>New User</title>
<script language = "JavaScript">
function validatePasswords() {
if (document.passForm.password1.value !=
document.passForm.password2.value) {
alert("Passwords don't match, try again");
document.passForm.password1.focus();
document.passForm.password1.select();
return false;
} else
return true;
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form name="passForm" method="post" onsubmit="validatePasswords()"
action="http://www.google.com">
<h1>New user password form</h1>
<p> Username: <input type="text" name="username"><br>
Password: <input type="password" name="password1"><br>
Check password: <input type="password" name="password2"><br>
<input type="submit" name="Submit" value="Submit">
</p>
</form>

</body>
</html>
-------------------
can u please tell me where am i going wrong
thank you
waiting eagerly for some suggestions
Brijesh
Jul 20 '05 #1
1 11729
In article <7b**************************@posting.google.com >,
br*****@divinetaccess.com enlightened us with...
i am relatively new to javascript
i am trying for a password validation code
but iam not able to stop the page from loading the page when the
password is wrong. the code is as below

<body bgcolor="#FFFFFF" text="#000000">
<form name="passForm" method="post" onsubmit="validatePasswords()"


You forgot the return.
onsubmit="return validatePasswords()"

--
-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lim Eng Teik | last post by:
I was asked by a client to make changes for their Outlook Web Access page where I need to validate Expiry Date of the Password and also the Password Length for the NT Account Policy. Initially I...
2
by: Christian Carlsen | last post by:
Hello, I need to validate a password: In order for the password to be accepted the following requirements must be met: At least one uppercase character (position in password is irrelevant) At...
7
by: Mike | last post by:
I've been trying for the past week to put a simple code together. I have done a LOT of searching, found scripts showing the functions I would like to use, however when I mix them it all goes wrong,...
9
by: Stirling | last post by:
Hi all, hope someone can help me, I am looking to do a password validation check using client side validation. Minimum requirement is that it must contain at least one number and one letter. ...
3
by: Morgan Roderick | last post by:
Hi How do I control the password complexity for users registering themselves in a webapp using Membership? From http://beta.asp.net/QUICKSTART/aspnet/doc/security/membership.aspx "Note that...
0
by: Steven | last post by:
Currently, I want to create a setup project which needs the user to input a specify password or validation code before installation. If the input password/validation code is not correct, the...
15
by: Eugene Anthony | last post by:
Is this method of validation for password and username considered to be secured. In my previous post I was given a solution that uses command object and the values are parsed by parameters. But the...
10
by: canam | last post by:
Hi: I hope someone can help me. Is there a way to add a password to a particular field in the event that the validation rule must be over written? I've created an input form in a...
1
by: shwethatj | last post by:
My problem is lik this , I am trying to create a registration form using javascript for a HR website , but i dont know how to provide password validation i.e the password and confirmation password...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.