Hi guys i'm trying to make a Login form that request login to an other server, the server returns a sessionid on success, which im gonna be using for the next part of my application, if i just send the form with no java i get the xml back with the session id, now I wanna use ajax to display a success message upon logged in, and parse that xml session id a hidden field, displaying the message inside a <div> or <span>. this is what i have so far, if anyone can point me on the right direccion on how to make this work will be very appreciated, thanks in advance.

the request string looks like this:
Code:
http://www.server-im-connecting/api.ashx?method=user.authenticate&partner_id=xxyyzzkkjjj&user=username&password=password
the response XML looks like this
Code:
<sessionid>4rcuxb55a1fsmjjamx2eylqi</sessionid>
Now this is what i was trying to make, but im sure is not the right way to build the javescript.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="javascript"  type="text/javascript">

var xmlHttp

function submitForm(this.value)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  
var url="http://www.server-im-connecting/api.ashx";
url=url+"?q="+value;
url=url+"&method="+"&partner_id="+"&user="+"&passwrod="();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{
var xmlDoc=xmlHttp.responseXML.documentElement;
document.getElementById("sessionid").innerHTML=
xmlDoc.getElementsByTagName("sessionid")[0].childNodes[0].nodeValue;

}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
</script>
</head>
<body> 
<form  method="GET" action=""> 
  <input type="hidden" name="method" value="user.authenticate" /> 
  <br /> 
  <input type="hidden" name="partner_id" value="xxyyzzkkjjj" /> 
  <br /> 
  user:
  <input type="text" name="user" value="" /> 
  <br /> 
  password:
  <input type="text" name="password" value="" /> 
  <br /> 
  <input type="Button" value="Submit" ONCLICK="submitForm()" /> 
</form>
<br />
<b><span id="sessionid"></span></b>
</body>
</html>