this is my php/html:
echo'<ol id="update">';
while($comments_row = mysql_fetch_array($comments_sql)){
echo'<li class="">'.$comments_row[textarea_keywords].' <a href="delete.php?id='.$comments_row[textarea_id].'" title="Remove Keyword">x</a></li>';
}
echo'</ol>
<div id="flash"></div>
<form action="#" method="post">
<textarea rows="7" cols="60" name="comment" id="comment" placeholder="enter your comment here"></textarea>
<input type="submit" class="submit" value=" Submit Comment " />
</form>this is my code:
$(function() {
$(".submit").click(function() {
var comment = $("#comment").val();
var dataString = 'comment=' + comment;
if(comment==''){
alert('Please Give Valide Details');
}else{
$("#flash").show();
$("#flash").fadeIn(400).html('<img src="ajax-loader.gif" align="absmiddle"> <span class="loading">Loading Comment...</span>');
$.ajax({
type: "POST",
url: "commentajax.php",
data: dataString,
cache: false,
success: function(html){
$("ol#update").append(html);
$("ol#update li:last").fadeIn("slow");
$("#flash").hide();
}
});
}
return false;
});
});
Edited by brown2005, 18 January 2013 - 03:03 PM.












