function postComment(){
var f = document.comment;
var thought = f.thought.value;
var url = "process_comments.php";
var postStr = "thought="+ thought;
var ajax=new XMLHttpRequest();
ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
if (ajax.readyState == 4 && ajax.status == 200) {
var errorMessage=ajax.responseText;
document.getElementById('errorMessage').innerHTML=errorMessage;
}
}
}
Type and save. You know the drill.
/*
if ($thought_error === true) {
echo "
}
*/
?>
Save
Clear