mrpatg mrpatg - 2 years ago 135
Javascript Question

clear textbox after form submit

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>

Answer Source

Add an id for the textarea.

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

Hook into the submit process and add:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download