SunQuest
 
           JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old December 18th, 2003, 10:25 AM
madddidley madddidley is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 2 madddidley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry Hmm

I'm trying to make this password thing and it doesnt work. I cant figure the thing our. I keep getting the error where i am calling the function at the onClick. I'm new to JavaScript and im still not sure about arguments. I think thats where its messing up. Also I saw var done = 0 and im not sure why that is there either. i got that from a website.

<!--PASSWORD FUNCTION-->
<script language="javascriipt">
<!--

function passWord() {
var done = 0;
var userName = document.myForm.name.value;
var pssWord = document.myForm.password.value;
var id1 = tweeder;
var id2 = dudley;
var id3 = stevedog;

var psw1 = 6904;
var psw2 = 1323;
var psw3 = 1111;

if (userName=="id1" && pssWord=="psw1") {
window.location="hank.htm"; done=1;}

if (userName=="id2" && pssWord=="psw1") {
window.location="hank.htm"; done=1;}

if (userName=="id3" && pssWord=="psw3") {
window.location="hank.htm"; done=1;}

else { alert("Invalid Information") }




}

//-->
</script>




<form name="myForm">

<table border="1" cellspacing="0" cellpadding="3">
<tr>
<td>ID: <div align="right"><input type="text" size="20" name="name"></div></td>
</tr>

<tr>
<td>Password: <div align="right"><input type="password" size="20"

name="password"></div></td>
</tr>

</table>

<input type="button" value="Login" onClick="passWord()">

</form>

Reply With Quote
  #2  
Old December 18th, 2003, 11:50 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
First off, um, don't use javascript to do your authentication. One needs only to read the source code to get into other areas of your site. Additionally, the pages you're redirecting to aren't secured, so anybody can read them.

That said, you might try either window.location.href or document.location.href rather than just window.location.

Also, please try to use descriptive title lines in any future posts rather than something useless like "Hmm."

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Hmm


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway