Monday 15 August 2011

javascript - clear form data after submit jquery -


How can I clear a form data after jquery succeeded?

  $ (document ()). (Function () {$ ('$ submit'). (Function () {$ .ajax ({type: "POST", url: 'final.php', data: "user =" + $ ('# User '). Val () + "& comment =" + $ (' # comment '). Val (), success: function (data) {$ (' # condition '). Html (data);}} );});});   

HTML ... After the form is submitted, I need to clear the form data .... Any help would be appreciated.

  & lt; Input type = "text" name = "user" id = "user" & gt; & Lt; Input type = "text" name = "comment" id = "comment" & gt; & Lt; Input name = "submit" type = "submit" id = "submit" & gt; & Lt; Div id = "status" & gt;    

$ ('form'). ('Input [type =



No comments:

Post a Comment