This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > June 2004 > Verifying Passwords





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Verifying Passwords
megajam02

2004-06-10, 12:14 pm

Hi,
Let me start by saying I'm a web design and Dreamweaver novice. I am building
a new user registration page for my site. So far, everthing is beautiful. I can
enter user info and submit, and my data is inserted into my database and my
"Thank You" page is displayed. My problem is that I have Password and Verify
Password fields in my form. I would like to be able to compare the two password
and ensure that they match before inserting the record into the database. I did
find one snippet of Javascript that is supposed to work, but when I insert it,
I get Header errors when I test it out. I've attached the script. Any
suggestion on how to do this in dreameaver without having to use Javascript, or
is this the best way to do it? I had hoped Dreamweaver would have something
relatively simple for this like a validation..

Thanks
Chris



<SCRIPT LANGUAGE = "JavaScript">

function verifyPassword(){
paswd1 = document.fmNewuser.tfPassword.value;
paswd2 = document.fmNewuser.tfPassword2.value;

if (paswd1 != paswd2){
alert("Passwords do not match!");
document.fmNewuser.tfPassword.focus();
document.fmNewuser.tfPassword2.select();
}
else{
alert("Your password has been accepted");
}
}
</SCRIPT>

Les Matthews

2004-06-10, 12:14 pm

Jaro's Check Form extension will do this for you.
http://www.yaromat.com/dw/?ex=Check%20Form%20MX

"megajam02" <webforumsuser@macromedia.com> wrote in message
news:ca9q7n$nl3$1@forums.macromedia.com...
> Hi,
> Let me start by saying I'm a web design and Dreamweaver novice. I am

building
> a new user registration page for my site. So far, everthing is beautiful.

I can
> enter user info and submit, and my data is inserted into my database and

my
> "Thank You" page is displayed. My problem is that I have Password and

Verify
> Password fields in my form. I would like to be able to compare the two

password
> and ensure that they match before inserting the record into the database.

I did
> find one snippet of Javascript that is supposed to work, but when I insert

it,
> I get Header errors when I test it out. I've attached the script. Any
> suggestion on how to do this in dreameaver without having to use

Javascript, or
> is this the best way to do it? I had hoped Dreamweaver would have

something
> relatively simple for this like a validation..
>
> Thanks
> Chris
>
>
>
> <SCRIPT LANGUAGE = "JavaScript">
>
> function verifyPassword(){
> paswd1 = document.fmNewuser.tfPassword.value;
> paswd2 = document.fmNewuser.tfPassword2.value;
>
> if (paswd1 != paswd2){
> alert("Passwords do not match!");
> document.fmNewuser.tfPassword.focus();
> document.fmNewuser.tfPassword2.select();
> }
> else{
> alert("Your password has been accepted");
> }
> }
> </SCRIPT>
>



Julian Roberts

2004-06-10, 12:14 pm

Massimo has an extension for this on his site somewhere
www.massimocorner.com

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004



megajam02

2004-06-10, 12:14 pm

Les,
You are the man! Downloaded it and it worked brilliantly. Thanks for bringing my several hour frustration to an end!

Chris
Les Matthews

2004-06-10, 12:14 pm

You're welcome.
As Julian pointed out, Massimo also has an extension that will accomplish
what you need. I find Massimo's Regular Expression Validator, Length
Validator, and Field Reformater extensions quite useful.

"megajam02" <webforumsuser@macromedia.com> wrote in message
news:ca9scj$qf6$1@forums.macromedia.com...
> Les,
> You are the man! Downloaded it and it worked brilliantly. Thanks for

bringing my several hour frustration to an end!
>
> Chris



megajam02

2004-06-10, 12:14 pm

Les,
You are the man! Downloaded it and it worked brilliantly. Thanks for bringing my several hour frustration to an end!

Chris
megajam02

2004-06-10, 12:14 pm

Julian. Thanks. This looks to be an excellent site for some extensions that I will surely need!

Chris
Michael Fesser

2004-06-10, 7:14 pm

.oO(megajam02)

>My problem is that I have Password and Verify
>Password fields in my form. I would like to be able to compare the two password
>and ensure that they match before inserting the record into the database. I did
>find one snippet of Javascript that is supposed to work, but when I insert it,
>I get Header errors when I test it out.


You don't want to check passwords with JS. Doing such security related
things on client-side is like having no check at all.

Use a server-side script.

Micha
Les Matthews

2004-06-10, 7:14 pm


"Michael Fesser" <netizen@gmx.net> wrote in message
news:k21hc05ph6jcgggedmfo35nfnm1bqbtkv7@4ax.com...
> You don't want to check passwords with JS. Doing such security related
> things on client-side is like having no check at all.
>
> Use a server-side script.


That's correct, but I don't think he is attempting to authenticate a
password. I think he wants to insert a new member record, and he wants to
validate that the user input the same password in two textfields.


Michael Fesser

2004-06-10, 7:14 pm

.oO(Les Matthews)

>That's correct, but I don't think he is attempting to authenticate a
>password. I think he wants to insert a new member record, and he wants to
>validate that the user input the same password in two textfields.


Ok, but doesn't really matter. Validation of user-submitted data should
_always_ be done on the server. What if JS is disabled?

Micha
Julian Roberts

2004-06-10, 7:14 pm

> Validation of user-submitted data
> should _always_ be done on the server.


Not neccessarily. There are plenty of scenarios where client-side validation
is sufficient. Particularly with ASP. As client-side validation is much
easier to do than server side validation. Although, the point is moot in
ASP.NET. As this kinda functionality is built-in.

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004


Michael Fesser

2004-06-10, 7:15 pm

.oO(Julian Roberts)

>Not neccessarily. There are plenty of scenarios where client-side validation
>is sufficient. Particularly with ASP. As client-side validation is much
>easier to do than server side validation.


Easier maybe, but never reliable. All what's done on client-side is easy
to fake or manipulate. With client-side validation only I can send
whatever I want to the server, for example code for SQL-injection.

Micha
Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews