computergeek
Programmer
Hello,
I have setup a login page (default.asp) which takes a user name, and password. This initial test page checks to see if the username has been entered. 2 values are set within a hidden form (UserName and Password) and the form is submitted. (I use client javascript code to accomplish this. See line document.loginform.submit(). My expected outcome is that the loginform action="Navigation.asp" will be loaded but it is not?!#$ The default.asp page is simply refreshed and displayed again. Does anybody have any ideas on what to check or what the problem could be? Why isn't my "Navigation.asp" being loaded? (I cut all the code out of this page for test purposes, and all it does is display a header...)
PLEASE HELP?!
Default.asp Code:
----------------
<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev 6.0">
<TITLE>Vendor Managed Inventory System Login</TITLE>
<script language="JavaScript" >
<!--
function doSubmit() {
if (document.formUser.uid.value != "" {
document.loginform.UserName.value = document.formUser.uid.value;
document.loginform.Password.value = document.formPassword.pw.value;
document.loginform.submit();
}
else {
window.alert("Please enter a user Name"
document.formUser.uid.focus();
}
}
//-->
</script>
</HEAD>
<body topmargin="0" leftmargin="0" bgcolor="#ffffff">
<table border="0" width="100%" height="100" bgcolor="#008080">
<tr>
<td align="middle" valign="center">
<font color="#ffffb0" size="6">Vendor
Inventory Management </font><font size="4" color="#ffffcc">for
the </font><font color="#ffffb0" size="6"> WEB </font></td>
</tr>
</table>
<br>
<table border="0" width="95%" align="center">
<tr>
<td>
<br>
<P align=center>
<b><font size="4"
style="FONT-STYLE: normal; FONT-WEIGHT: normal"
> Welcome to VMI. </font></b>
</P>
</td>
</tr>
</table>
<noscript>
<br><br>
<p align="center"><font size="+1" color="#cc0000">
JavaScript has not been enabled, or you are using a browser that does not support Javascript. <br>
Please enable JavaScript or use an appropriate browser, such as Microsoft Internet Explorer. <br>
</font></p>
<p align="center"><font color="#cc0000"> Thank You. <br>
</font>(reload this page
when JavaScript has been enabled) </FONT></p>
</noscript>
<br> <br>
<!-- form with hidden fields... form is never visible to the user -->
<form name="loginform" action="Navigation.asp" method="post" id="loginform">
<input type="hidden" name="UserName">
<input type="hidden" name="Password">
</form>
<table border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<form id="formUser" name="formUser" onSubmit="return doSubmit();">
<td align="right">
<font face="arial" size="2"><b> User Name </b></font>
</td>
<td align="left">
<input type="text" size="12" name="uid" value="">
</td>
</form>
</tr>
<tr>
<form id="formPassword" name="formPassword" onSubmit="return doSubmit();">
<td align="right">
<font face="arial" size="2"><b> Password </b></font>
</td>
<td align="left">
<input type="password" size="12" name="pw" value="">
</td>
</form>
</tr>
<tr>
<form id="formLogin" name="formLogin" onSubmit="return doSubmit();">
<td align="center" colspan="2">
<br>
<input type="submit" value="Login" width="100" height="30" border="0" alt="Log In Now" >
</td>
</form>
</tr>
</table>
</td>
</tr>
</table>
<SCRIPT LANGUAGE="javascript">
//document.loginform.UserName.focus();
//document.formUser.uid.focus();
</SCRIPT>
</body>
</HTML>
I have setup a login page (default.asp) which takes a user name, and password. This initial test page checks to see if the username has been entered. 2 values are set within a hidden form (UserName and Password) and the form is submitted. (I use client javascript code to accomplish this. See line document.loginform.submit(). My expected outcome is that the loginform action="Navigation.asp" will be loaded but it is not?!#$ The default.asp page is simply refreshed and displayed again. Does anybody have any ideas on what to check or what the problem could be? Why isn't my "Navigation.asp" being loaded? (I cut all the code out of this page for test purposes, and all it does is display a header...)
PLEASE HELP?!
Default.asp Code:
----------------
<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev 6.0">
<TITLE>Vendor Managed Inventory System Login</TITLE>
<script language="JavaScript" >
<!--
function doSubmit() {
if (document.formUser.uid.value != "" {
document.loginform.UserName.value = document.formUser.uid.value;
document.loginform.Password.value = document.formPassword.pw.value;
document.loginform.submit();
}
else {
window.alert("Please enter a user Name"
document.formUser.uid.focus();
}
}
//-->
</script>
</HEAD>
<body topmargin="0" leftmargin="0" bgcolor="#ffffff">
<table border="0" width="100%" height="100" bgcolor="#008080">
<tr>
<td align="middle" valign="center">
<font color="#ffffb0" size="6">Vendor
Inventory Management </font><font size="4" color="#ffffcc">for
the </font><font color="#ffffb0" size="6"> WEB </font></td>
</tr>
</table>
<br>
<table border="0" width="95%" align="center">
<tr>
<td>
<br>
<P align=center>
<b><font size="4"
style="FONT-STYLE: normal; FONT-WEIGHT: normal"
> Welcome to VMI. </font></b>
</P>
</td>
</tr>
</table>
<noscript>
<br><br>
<p align="center"><font size="+1" color="#cc0000">
JavaScript has not been enabled, or you are using a browser that does not support Javascript. <br>
Please enable JavaScript or use an appropriate browser, such as Microsoft Internet Explorer. <br>
</font></p>
<p align="center"><font color="#cc0000"> Thank You. <br>
</font>(reload this page
when JavaScript has been enabled) </FONT></p>
</noscript>
<br> <br>
<!-- form with hidden fields... form is never visible to the user -->
<form name="loginform" action="Navigation.asp" method="post" id="loginform">
<input type="hidden" name="UserName">
<input type="hidden" name="Password">
</form>
<table border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<form id="formUser" name="formUser" onSubmit="return doSubmit();">
<td align="right">
<font face="arial" size="2"><b> User Name </b></font>
</td>
<td align="left">
<input type="text" size="12" name="uid" value="">
</td>
</form>
</tr>
<tr>
<form id="formPassword" name="formPassword" onSubmit="return doSubmit();">
<td align="right">
<font face="arial" size="2"><b> Password </b></font>
</td>
<td align="left">
<input type="password" size="12" name="pw" value="">
</td>
</form>
</tr>
<tr>
<form id="formLogin" name="formLogin" onSubmit="return doSubmit();">
<td align="center" colspan="2">
<br>
<input type="submit" value="Login" width="100" height="30" border="0" alt="Log In Now" >
</td>
</form>
</tr>
</table>
</td>
</tr>
</table>
<SCRIPT LANGUAGE="javascript">
//document.loginform.UserName.focus();
//document.formUser.uid.focus();
</SCRIPT>
</body>
</HTML>