I use the function below to send user comments to a database and get refreshed on the current page - no problems.
However, I cannot seem to "erase" the contents of the comments form (id=NewCommentZ) for subsequent use - the text area and text input elements remain populated with the previously entered content.
The disabled lines in the code below are my guesses - no more - of how to erase the form's contents, but I wasn't lucky.
I'd appreciate someone providing me with some direction/hint towards a solution.
Thanks,
Bruce
$.fn.ajaxSubmit = function(e) {this.submit(function(){ var params = {}; $(this) .find("[EMAIL PROTECTED], [EMAIL PROTECTED]'text'], [EMAIL PROTECTED]'hidden'], [EMAIL PROTECTED]'password'], [EMAIL PROTECTED], textarea") .filter(":enabled") .each(function() { params[ this.name || this.id || this.parentNode.name || this.parentNode.id ] = this.value; }); toggleContent('NewCommentZ');$.post(this.getAttribute("action"), params, function(text){
$("div#comments2").html(text).fadeIn("slow");
$('#hilightcomment').highlightFade({color:'yellow',speed:2000,iterator:'linear'})
//$("NewCommentZ").html("");
//$(this).find("[EMAIL PROTECTED], [EMAIL PROTECTED]'text'], [EMAIL PROTECTED]'hidden'], [EMAIL PROTECTED]'password'], [EMAIL PROTECTED], textarea").html("");
}); return false; });}
_______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/