User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 373,527 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,771 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 12814 | Replies: 6
Closed Thread
Join Date: Feb 2005
Location: England
Posts: 91
Reputation: NuGG is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
NuGG's Avatar
NuGG NuGG is offline Offline
Junior Poster in Training

Help "<SCRIPT SRC>" javascript logon help

  #1  
Mar 16th, 2005
Ok, ive created a login script and i have saved it as login.js. See below:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="someone" && password=="something") { window.location="page.htm"; done=1; }
if (done==0) { alert("Invalid login! (try lower case)"); }
}
// End -->
</SCRIPT>

<text>
<center>
<form name=login>
<table width=225 border=1 cellpadding=3>
<tr><td colspan=2><center><font size="+2"><b>Secure Area!</b></font></center></td></tr>
<tr><td>Username:</td><td><input type=text name=username size="20"></td></tr>
<tr><td>Password:</td><td><input type=password name=password size="20"></td></tr>
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
</table>
</form>
</center>
</text>


I have added the following to the page on which the login script should appear:

<SCRIPT SRC="login.js" language="JavaScript/text">
</SCRIPT>


The script its self works, but it does not work from the login.js file. What am i doing wrong?

Greatful for any help you can give me,

NuGG
AddThis Social Bookmark Button
 
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 107
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: "<SCRIPT SRC>" javascript logon help

  #2  
Mar 16th, 2005
have you tried debugging it with an alert (to make sure the HTML is importing the script?) something like: alert("made it to such and such function"); and stick that in a function in the external.js file, and then in your HTML code, when you call the function (that is supposed to be in the external.js file) it should come up with an alert. This way, you know the browser is actually retrieving the javascript code.
 
Join Date: Feb 2005
Location: England
Posts: 91
Reputation: NuGG is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
NuGG's Avatar
NuGG NuGG is offline Offline
Junior Poster in Training

Re: "<SCRIPT SRC>" javascript logon help

  #3  
Mar 16th, 2005
you again?!



Cheers, Ill give it a go...
 
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 107
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: "<SCRIPT SRC>" javascript logon help

  #4  
Mar 16th, 2005
I can remain silent if you would rather.... my name says it all.
 
Join Date: Apr 2004
Location: Tracy
Posts: 743
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Rep Power: 7
Solved Threads: 31
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

Re: "<SCRIPT SRC>" javascript logon help

  #5  
Mar 17th, 2005
just a question though...does it matter to have the src="location of script" then?type="text/javascript"

also, have you tried removing the actualy <script tags from it? i know that when i went to do what your doing but for an image swap program, that i had to remove the <script> and </script> from the script itself and save it to its own JS file, before that i was having issues getting it to work.
!!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!

sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
 
Join Date: Oct 2006
Posts: 14
Reputation: Andy-Pandy is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Andy-Pandy Andy-Pandy is offline Offline
Newbie Poster

Re: "<SCRIPT SRC>" javascript logon help

  #6  
Oct 21st, 2006
Can I make several users for this little script?
And if I can, how?

Hope it works


(And by the way, when I use it, it says on the status bar "Something's wrong on the site" How come?)

From Anders
Last edited by Andy-Pandy : Oct 21st, 2006 at 4:32 pm. Reason: Forgot something in my post
 
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: "<SCRIPT SRC>" javascript logon help

  #7  
Oct 21st, 2006
You're bumping a thread nearly 2 years old... it is doubtful you'll get a response from the original poster. Please start a new thread and ask your questions there.
 
Closed Thread

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 6:35 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC