Jump to content

Location on a page of Ajax reply


ameliabob

Recommended Posts

I have written a simple routine but the response isn't where the ID is located. In the code it is under the input text field but in the running display it is above the text field. This is the browser side code.

  var myRequest = GetXMLHttpRequest();		  function StateChanged(){  	if ( myRequest.readyState == 4 ) {  // HTTP response is "OK"	    if( myRequest.status == 200 ) { // and  with no errors			document.getElementById("signonResponse").innerHTML=myRequest.responseText;		} else {    				    //  show error				alert( "An error has occurred: " + myRequest.statusText);			alert( "the other: " + myRequest.responseText);		}	}	  }    function CheckInput() {  		myRequest.onreadystatechange=StateChanged;   		myRequest.open("POST","signon.php",true);		myRequest.send(null);  }</script></head><body bgcolor="#99ffff"><form name="login" ><br><br><br><br><br><br><br><br><br><br><br><center><h2>Sign in to your account</h2><br><br><table border ="0"><tr><td>Enter your e-mail address</td><td><input type="text" name="uName" id="uName" ></td></tr><tr><td> </td><td><input type="button"  onClick="CheckInput()" value="Sign In" title="Click here to sign in to the system"></td></tr></center><input type="hidden" id="xxx" name="finals"><div id="signonResponse"><p></p></div></form ></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...