/    Sign up×
Community /Pin to ProfileBookmark

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” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>

<html xmlns=”http://www.w3.org/1999/xhtml“>
<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>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@rootNov 25.2013 — Ask yourself what does ASP have to do with JavaScript?
×

Success!

Help @jon80 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...