ben bu javascript, onun sayfayı yeniden ve formu göndermeden ile değil sorun yaşıyorum. !
var xmlHttp
function GetXmlHttpObject(){
var objXMLHttp=null;
if (window.XMLHttpRequest){
objXMLHttp=new XMLHttpRequest();
}else if (window.ActiveXObject){
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
return objXMLHttp
}
function ajax_module()
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null){
alert ("Browser does not support HTTP Request");
return
}
xmlHttp.open('POST', 'save.php');
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xmlHttp.send('user='+document.form1.user1.value+'&text='+document.form1.text1.value);
document.form1.test1.value = '';
document.form1.test1.focus();
}
HTML
<form name="form1" method="POST" onsubmit="ajax_module(); return false;">
<textarea name='text1'></textarea>
<input type='hidden' name='user1' value='$user' />
<input type="submit" name="submit" value="submit" />
</form>