ok I got it to send the post request but the php script doesn't see the request. the dump from the $_POST is array(0) { }
here is the updated code
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="test2.js"></script>
<link rel="stylesheet" type="text/css" href="test4.css" id="linkPage" />
<title>
test site
</title>
</head>
<body>
<div id="yourdivname">
</div>
<form action="" method="post" id="myform">
<input type="text" id="mytextbox" />
<input type="submit" id="submit1" value="Send" />
</form>
<script type="text/javascript">
var submit1 = document.getElementById('myform');
submit1.addEventListener("submit",function sendmessage (e) {
var xhr = new XMLHttpRequest
xhr.open("POST", "send.php");
xhr.send(new FormData(myform));
submit1.reset();
e.preventDefault()
},false);
</SCRIPT>
</html>