Greetings,
I am trying to create a page which allows the database to be updated from the front page. I have not found alot of references with asp and javascript and the samples I have seen referer to a one page operation or XML.
While I am not opposed to XML, I don't have too much experience working with it.
The code I currently have is as follows
ADDUSER.ASP
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
function validateuserid(suserid) {
document.body.style.cursor
='wait';
// Create an instance of the XML HTTP Request object
var oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
var sURL = "
http://localhost/stPats/test/checkuser.asp?userid=" + suserid
oXMLHTTP.open( "POST", sURL, false );
// Execute the request
oXMLHTTP.send();
alert(oXMLHTTP.responseTex
t)
if (oXMLHTTP.responseText == "exists")
alert("Sorry - the User ID " + suserid + " already exists.");
else
alert("good name");
document.body.style.cursor
='auto';
}
</SCRIPT>
<html>
<head>
<title>
</title>
</head>
<body>
<input type=text name=userid value="" onChange="validateuserid(t
his.value)
">
<span ie=test></span>
</body>
</html>
<script type=text/javascript>
alert("HERE")
</script>
<%
CHECKUSER.ASP
'Capture the username
sUserID = Replace(Trim(Request.Query
String("us
erid")),"'
","")
response.write(sUserID)
if suserID = "me" then
Response.Write "exists"
else
response.write "available"
end if
'Clean up
%>
The second page is not alertiing the "hello" message.
This is probably really messed up, but any help is appreciated.
Start Free Trial