Can anyone let me know what is wrong with my logon form (ASP.NET/JS), since I would like to submit the form, and, ideally read the user and password from the db?
So far the hardcoded version does not work either…
<%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Logon.aspx.cs” Inherits=”Logon” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “
<html xmlns=”
<head runat=”server”>
<title></title>
<style type=”text/css”>
#Text1
{
width: 146px;
margin-left: 21px;
}
#Password1
{
width: 147px;
}
.style1
{
font-family: Arial, Helvetica, sans-serif;
}
#user
{
width: 41px;
margin-left: 96px;
}
</style>
<script language=”javascript” type=”text/javascript”>
// <![CDATA[
function setCookie(c_name, value, exdays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays == null) ? “” : “; expires=” + exdate.toUTCString());
document.cookie = c_name + “=” + c_value;
}
function Submit1_onclick() {
/* Logon credentials to be submitted and verified by the server control */
var user = document.getElementById(‘user’).Value;
var pwd = document.getElementById(‘pwd1’).Value;
if (user = “1”) && (pwd = “1”)
{
return true;
document.getElementById(“Text1″).Value=”authOK”;
document.forms[0].submit();
}
else {
document.getElementById(“Text1″).Value=”NoAuth”;
}
}
function Submit1_onclick() {
}
// ]]>
</script>
</head>
<body id=”body”>
<form id=”form1″ runat=”server”>
<div>
<span class=”style1″>Aristotle library information system</span><br />
<asp:Image ID=”Image1″ runat=”server” Height=”102px”
ImageUrl=”~/img/Aristotle_Bust_White_Background_Transparent.png” Width=”88px” />
<br />
<br />
Logon:
<input id=”user” type=”text” onclick=”return Text1_onclick()” /><br />
Password:
<input id=”pwd1″ type=”password” /><br />
Store logon information?<input id=”Checkbox1″ type=”checkbox” /><br />
<input id=”Submit1″ type=”submit” value=”logon”
onclick=”return Submit1_onclick()” onclick=”return Submit1_onclick()” /></div>
</form>
</body>
</html>