IM NOT SURE IF THIS ONES GONNA WORK... TRY IT,
<html>
<head>
<title>FTP login</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
//
// This Function sets the 'Usernsme' feild into focus.
//
function toForm() {
document.login.username.focus();
}
//
// This Function makes sure both of the feilds are filled out, otherwise an 'Alert' will pop up to alert them to fill them out.
// Please enter your "ftpserver.com" address in the 'var ftpsite' line of code.
//
function Login(form) {
var username = form.username.value;
var password = form.password.value;
if (username && password) {
var ftpsite = "ftp://" + username + ":" + password + "@" + "ftpServer.com";
window.location.href = ftpsite;
} else {
alert("Please enter your username, and password.");
}
}
</script>
<script language=3D"Javascript">
//
// This function allows the "Enter" key to submit the form.
//
// I know the input feilds do not have the right naming convention to utilize this Function.
// This is where I am drawing a blank.
// I am trying to validate the form to make sure that both feilds are filled in, otherwise alert.
//
function EnterHandler(oElm) {
if(event.keyCode =3D=3D 13){
var intNewIndexFocus =3D parseInt(oElm.getAttribute("indexNo"), 10) + 1;
var arrInputFields =3D
document.getElementById("myform").getElementsByTag Name("input");
for(var i=3D0; i<arrInputFields.length; i++){
var oInput =3D arrInputFields[i];
if(oInput.getAttribute("type") =3D=3D ="text" && parseInt(oInput.getAttribute("indexNo"), 10) =3D=3D = intNewIndexFocus) {
oInput.focus();
}
}
event.returnValue =3D false;
}
}
</script>
</head>
<body onLoad="toForm()" onLoad="EnterHandler(oElm)" onLoad="Login(form)" bgcolor="#660000" text="#FFFFFF" link="#FFFFFF" vlink="#CCCCCC" alink="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>
<form name=login>
<br>
<br>
<table width=300 border=1 align="center" bordercolor="#993300">
<tr bgcolor="#993300">
<td height="60" colspan=2 align=center><b>
<h2> </h2>
</b></td>
</tr>
<tr>
<td><div align="right"><strong>Username:</strong></div>
</td>
<td>
<input type=text name=username size=20>
</td>
</tr>
<tr>
<td><div align="right"><strong>Password:</strong></div>
</td>
<td>
<input type=password name=password size=20>
</td>
</tr>
<tr>
<td> </td>
<td><input name="button" type="button" onClick="Login(this.form)" value="Submit">
<input type="reset" name="Reset" value="Reset">
</td>
</tr>
<tr>
<td colspan=2 align=center><p> </p>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
:D bloody_thief® and liQuid_iMager®,
:D making things a lil bit simple.
|