Clear the form once form submitted

Posted by zurna on Stack Overflow See other posts from Stack Overflow or by zurna
Published on 2010-04-17T17:12:05Z Indexed on 2010/04/17 17:23 UTC
Read the original article Hit count: 163

Filed under:

Once the form submitted, response from another page is printed to #GameStorySys. But values entered to the form still stays there. Is it possible for the form values to disappear (but the form should still stay) once the form submitted?

$("[name='GameStoryForm']").click(function() { 
        $.ajax({
            type: "POST",
                data: $("#GameStoryForm").serialize(),
                url: "content/commentary/index.cs.asp?Process=EditLiveCommentaryStory&CommentaryID=<%=Request.QueryString("CommentaryID")%>", 
                success: function(output) { 
                $('#GameStorySys').html(output);
            },
                error: function(output) {
                $('#GameStorySys').html(output);
                }
        }); 
}); 

© Stack Overflow or respective owner

Related posts about jQuery