|
<%@LANGUAGE="JAVASCRIPT"%>
<html>
<head>
<title>Registration</title>
<!-- #INCLUDE FILE="INC/chatprocessing.asp" -->
<%
var nick, password, firstName, lastName, email;
nick = Request.Form("Nick");
password = Request.Form("Password");
firstName = Request.Form("FirstName");
lastName = Request.Form("LastName");
email = Request.Form("Email");
var strError = "";
if(nick.Count > 0) {
var userID = registerUser(nick, password, firstName, lastName, email);
if(userID == -1) {
strError = "User already exists.";
}
else {
var redirectTo = "default.asp?UserID=" + nick;
Response.Redirect(redirectTo);
}
}
%>
<script>
<!--
function onProcessRegister() {
var isFilled = ((document.frmReg.FirstName.value != "") &&
(document.frmReg.LastName.value != "") &&
(document.frmReg.Nick.value != "") &&
(document.frmReg.Email.value != "") &&
(document.frmReg.Password.value != "") &&
(document.frmReg.Password1.value != ""));
var isEqualPasswords =
(document.frmReg.Password.value == document.frmReg.Password1.value);
if(!isFilled) {
alert("Fields not complete!");
}
else if(!isEqualPasswords) {
alert("Passwords are not equal!");
}
else {
document.frmReg.submit();
}
}
//-->
</script>
</head>
<body>
<h1 align="center">Registration</h1>
<form id="frmReg" name="frmReg" action="register.asp" method="post">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><font color="#FF0000"><%=strError%> </font></td></tr>
<tr>
<td>First Name</td>
<td><input id="FirstName" name="FirstName" maxlength="100" value="<%=firstName%>"></td>
</tr>
<tr>
<td>Last Name</td>
<td><input id="LastName" name="LastName" maxlength="100" value="<%=lastName%>"></td>
</tr>
<tr>
<td>Nick</td>
<td><input id="Nick" name="Nick" maxlength="20" value="<%=nick%>"></td>
</tr>
<tr>
<td>Email</td>
<td><input id="Email" name="Email" maxlength="100" value="<%=email%>"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" id="Password" name="Password" maxlength="20"></td>
</tr>
<tr>
<td>Confirm password </td>
<td><input type="password" id="Password1" name="Password1" maxlength="20"></td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr><td colspan="2" align="right"><input type="button" value="Register" onClick="onProcessRegister()"></td></tr>
</table>
</form>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here