Subject: code works in IE but not netscape
Posted By: Toka1 Post Date: 11/26/2003 10:05:17 AM
Hi

I have a login script that works fine in IE but nothing happens in netscape.

//This is in the head of the page
function Login(form) {
var form = document.forms[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();
}
function test() {
window.setTimeout('child.location.href="http://217.34.217.125"', 3000);
}
}
else {
alert("Please enter your username and password.");
   }
}


//this is in the body of the page
<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></form><form onSubmit = "Javascript:doSearch(window);return(false)"><input name="search" size = 18><input type="image" onClick="doSearch(window); return false;" src="/local/it/uniq0371d.nsf/Search_29.jpg?OpenImageResource" border =0></form>



could anyone advise as to how I can adapt the code to allow it to function in both browsers.

Thanks in advance for any help given

Toka1

Reply By: joefawcett Reply Date: 11/26/2003 11:11:23 AM
Well the nested functions look a bit odd, perhaps NN doesn't like them. It's all very complicated, why have two submits? I've also found that naming things password that are of type password can cause odd things to happen. Is all you want to do collect username and password to get to a secure site?


--

Joe
Reply By: Toka1 Reply Date: 11/27/2003 4:35:45 AM

Hi Joe

Yes all I want to do is collect user name and password which goes to server for authentication.

Thanks

Toka


Go to topic 6949

Return to index page 997
Return to index page 996
Return to index page 995
Return to index page 994
Return to index page 993
Return to index page 992
Return to index page 991
Return to index page 990
Return to index page 989
Return to index page 988