I am busting my head attempting to figure out this code. As you can see, if you type the username "KFoster" and the password "MST3K", you should be directed to another website. I've been through the code several times but to no avail. Here it is . . . (sorry it is heavily commented)
-Many thanks
<html>
<head>
<title>Login Form</title>
</head>
<!--Begin body of HTML document with formatting -->
<body background="../bkgnd.gif">
<H1 align="center"><font color="#000080" face="Verdana">Hidden Valley Vineyards Login Form</H1>
<center><img src="vine.jpg"></center>
<!--Form Name is frmLogin -->
<form method="post" name="frmLogin" action="javascript:void(0)">
<br><br>
<!--Create 1 button and assign a function(login()) to the button(btnLogin) -->
<input type="button" value="Go to the Department Website" name="btnLogin" onClick="login()">
<!--Create 1 button to clear the screen -->
<input type="reset" value="Clear Form" name="btnClear">
</form>
</center>
</body>
<script language="javascript">
<!-- Create function login() -->
function login(){
<!-- Declare three variables -->
var strUserName, strPassword, strDepartment;
<!-- Assign intPrice to txtPrice textbox -->
strUserName=document.frmLogin.txtUserName.value;
<!-- Assign intTax to txtTax textbox -->
strPassword=document.frmLogin.txtPassword.value;
<!-- Assign intTax to txtTax textbox -->
strDepartment=document.frmLogin.1stDepartment.value;
switch (strUserName){
case "KFoster":
if (strPassword == "MST3K") {
window.location.href = strDepartment + ".htm";
}
else{
window.location.href = "loginFormJS.htm";
}
I'm happy to hear you were able to resolve your problem.
But, although I appreciate your offer of remuneration there really is no need. You will find that the members of Coding Forums volunteer their time and freely assist anyone seeking a solution to any number of coding problems.
Glad I could help.
And welcome to Coding Forums....