Click to See Complete Forum and Search --> : login problem


Toka
11-24-2003, 09:43 AM
Hi

Please could anyone help a.s.a.p

I have a login form which works fine in explorer but won't work in netscape can anyone help.

I have the following code in the head of the document

function Login(form) {
var form = document[0];
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && password && server) {
var htsite = "http://" + username + ":" + password + "@" + server;
window.location = htsite;
function login() {
var username = frmLogin.username.value;
var password = frmLogin.password.value;
var server = "217.34.217.125";
var site = "http://" + username + ":" + password + "@" + server;
child = window.open(site,'child','');
test();
}


And the following in the body

<form name=login>
<input type="hidden" name="server" value="217.34.217.122/Prod
Cat/default.asp?Region=Compressor">
<B><Font Face="Arial" size="1" color="#000080">Username:</Font></B>
<input type=text name=username size=18>
<B><Font Face="Arial" color="#000080" size="1">Password:</Font></B>
<input type=password name=password size=18>
<a href="javascript:Login(this.form)">
<img src="/local/It/uniq0371d.nsf/GO_44.jpg?OpenImageResource" border = "0">
</a></form>

I have also attache the full document

Thanks in advance for any response/help

Toka

Gollum
11-24-2003, 10:11 AM
The first thing I can see is the line

var form = document[0];


you should probably change that to

var form = document.login;

or

document.forms[0];

ray326
11-24-2003, 11:26 AM
Gollum has put you on the right track but you should get the latest version of Netscape, Mozilla or Firebird and use its built in Javascript Console to debug your scripts.

Toka
11-25-2003, 07:26 AM
Hi

Thank you gollum, that seemed to help a bit but it is still not functioning properly.


Also thanks for that tip ray326, I will try out the netscape debugger this evening and see if that helps me to figure it out.

Thanks again to both of you for your quick response, very much appreciated.

Toka

Toka
11-25-2003, 08:22 AM
Hi Ray326

I can't seem to figure out how to use the javascript console and there dosen't seem to be any info in the help.

Please could you explain how to use it if poss

Thanks
Toka

ray326
11-25-2003, 10:20 AM
All you do is open it using Tools/Web Development/JavaScript Console then view a page containing your script. You can also type snippets of Javascript into the text box under the toolbar and it will evaluate that and present the results in the log area below.

Check out this article about Using Mozilla in Testing and Debugging Web Sites: http://devedge.netscape.com/viewsource/2003/mozilla-webdev/