rendered paste bodyfunction submitAssignForm(event,form){
var file = 'data.php';
var str = getFormValues(form,"validate");
xmlReq = getXML(file,str);
if (xmlReq){
alert(xmlReq);
var response = xmlReq.responseXML;
// alert(response);
var response_details = response.getElementsByTagName('response');
alert(response_details.length);
if (response_details.length > 0){
alert(response_details[0].getAttribute('user_id'));
alert(response_details[0].getAttribute('purchase_id'));
}
}
if (window.event) window.event.returnValue = false;
else event.preventDefault();
return false;
}
function getXML(file,str){
var xhr = remoteRequestSetup();
if (xhr){
xhr.onreadystatechange = function(){
if(xhr.readyState == 4){
if(xhr.status == 200) {
alert('should be working');
// return xhr;
}
else alert('Error code ' + xhr.status);
}
};
}
xhr.open( "POST", file, true );
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
xhr.send(str);
return xhr;
}