Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verifying password entries 1

Status
Not open for further replies.

raymondbirch

Technical User
Jun 28, 2001
12
0
0
SE
Hi, how do you create a 2nd "password" form field in Dreamweaver Ultradev that checks the 1st "password" field to make sure the user has repeated it correctly. I am using Access V2.0 database which works fine. In Macromedias help they show a form with the "verify password" field in the form, but not how to ceate it !

Thanks
Raymond
 
<form name=theForm onSubmit=&quot;return checkPass();&quot;>
<input type=password name=p1>
<input type=password name=p2>
</form>

<script language=javascript>
function checkPass(){
if (document.theForm.p1.value != document.theForm.p2.value){
alert('Passwords don't match!');
return false;
}
else
return true;
}
</script>

hope that helps! :)
Paul Prewett
penny.gif
penny.gif
 
Thanks link9, now the crux of it....how do i integrate that script with a form allready created with Ultradevs &quot;Live Object&quot; form creator, which links to a &quot;mdb&quot; file that only contains (1) password field. Sorry for the beginners stupido questions ;)

By the way....you were darn quick....
 
Ok, well... I'm not an UltraDev user (which begs the question why do I peruse this forum), so I'll have to tell you how to do it manually. If you crack open your source code, you will need to find a few pieces of information:

(1) the name of your form, which will be in the form tag. If it doesn't have one, give it one -- I usually just call mine theForm

(2) the name of your first password box --

(3) you're going to need to add the second password box if it isn't already there, and then get the name of it, as well.

You then go to your form tag, and add the onSubmit action like I posted above:

<form name=theForm method=post action=somePage.asp onSubmit=&quot;return checkPass();&quot;>

So that when the submit button is pressed, that function will run before the form is actually submitted...

You then might have to modify the function that I posted in order to reflect the name of your form and the elements that you want to compare.

And there you have it... form validation.

:)
Paul Prewett
penny.gif
penny.gif
 
Hello Link9 (Paul Prewitt)
It WORKS !!!!!
You are a genius THANKS :)

I´m learning this so if you want to see my very lame attempt at this script, then go to this site and see what i have achieved so far...

once again THANKS :) Hope i can help someone some day.

Raymond Birch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top