satırından sonra
document.comment_form.id.value=''; document.comment_form.name.value=''; document.comment_form.captcha_code.value=''; document.comment_form.comment.value='';ekleyin gönderi sonrası inputlar sıfırlanacaktır...
19
●1.163
function c_reset() {
document.comment_form.name.value='';
document.comment_form.captcha_code.value='';
document.comment_form.comment.value='';
return false;
} mysql_query("INSERT INTO yorumlar (id, name, comment) VALUES ('$id', '$name', '$comment')");
echo '<span style="color:#CC0000;">Yorumunuz eklenmistir. Tesekkürler.</span>
<script type="text/javascript">
window.onload = function(){
c_reset();
}
</script>';Ayrica window.onload yerine document.onload denedim buda basarisiz.
xmlspan.innerHTML = xmlhttp.responseTextbul altına
if(xmlhttp.responseText=='<span style="color:#CC0000;">Yorumunuz eklenmistir. Tesekkürler.</span>'){
c_reset();
}<script type="text/javascript">
window.onload = function(){
c_reset();
}
</script> if(xmlhttp.responseText=='id="Yorumu_Sil"'){
c_reset();
}Denedim olmadi id nin basinda ve Sil" in sonunda biseyler eksik sanirim o satiri bulabilmesi icin. Bu tür durumlarda satirin tamamina degilde satirin icinden biseyler nasil aliniyor.
if(document.getElementById("Yorumu_Sil").innerHTML = xmlhttp.responseText) {