Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  11] [ 4]  / answers: 1 / hits: 49182  / 15 Years ago, sat, december 5, 2009, 12:00:00

I have a form which posts using ajax and reloads the div underneath.



I need the textbox to clear when the submit button is pressed.



<form name=goform action= method=post>
<textarea name=comment></textarea>
<input type=submit value=submit>
</form>

More From » jquery

 Answers
34

Add an id for the textarea.



<textarea name='comment' id='comment'></textarea>


Hook into the submit process and add:



$('#comment').val('');

[#98140] Wednesday, December 2, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jazminuniquer

Total Points: 63
Total Questions: 121
Total Answers: 96

Location: Cambodia
Member since Thu, May 21, 2020
4 Years ago
;