Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Password Comparision (Easy)

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,181
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Password Comparision (Easy)
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Password Comparision (Easy) - 6/18/2001 4:15:01 AM   
  israelda

 

Posts: 13
Score: 0
Joined: 5/23/2001
From: Israel
Status: offline
I am sure this is a very easy problem for some of you guys. I am
new to VBScript so its a little hard for me. I am trying to make a
password form that verify that the password i typed in the first
textbox is equal to the second text box heres the code i have...


<script language="VBScript">
Function VerifyPWD ()
If lcase(RegisterForm.Password.Value) =
lcase(RegisterForm.verifypassword.value) then
else
Msgbox ("Please verify that the passwords match")
exit sub
end if
End Function
</script>

And this is where I call it...

<form name="registerform" method="post" action="register.asp"
onSubmit="Call VerifyPWD()">

For some reason I keep getting the error "Cannot use parenthesis
when calling a sub" any idea?

Thanks!
 
 
Post #: 1
 
 Re: Password Comparision (Easy) - 6/18/2001 4:16:28 AM   
  countryfun

 

Posts: 12
Score: 0
Joined: 5/31/2001
From: USA
Status: offline
Just call the sub without the parentheses...

VBScript doesn't like them (unlike JavaScript)

VerifyPWD

(in reply to israelda)
 
 
Post #: 2
 
 Re: Password Comparision (Easy) - 6/18/2001 4:17:50 AM   
  Therarez

 

Posts: 12
Score: 0
Joined: 5/22/2001
From: Mexico
Status: offline
Hiya
I understand where you're coming from, I wanted to develop
something similar for my website. Hope this can help you, you
basically had this anyway, you just have to decalre a seperate
variable for the second input (password) box.
Try it out!!

<html>
<body>
<Form name="look" Method=Post>
<Input Type=Text Name="TxtSearch" size="14" maxlength="20">
<Input Type=Text Name="TxtSearch2" size="14"
maxlength="20">
<Input Type=Button Name=Submit Value="Go!"
onClick="goSearch()">
</Form>
<Script Language=VBScript>
Sub GoSearch()
dim searchit, verify
searchit=Document.look.txtsearch.Value
verify =Document.look.txtsearch2.Value
If searchit = verify then
msgbox "well done, these passwords match"
Else
msgbox "sorry, the passwords didn't match"
End If
End Sub
</Script>
</body>
</html>

(in reply to israelda)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Password Comparision (Easy) Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts