Clear form fields with JQuery on a asp.net page that includes IHttpHandler -


none of solution above(clear form fields jquery) works on simple case when page includes call web user control involves ihttphandler request processing (for captcha regenaration). after sending requsrt (for image processing) code below not clear fields on form (text ntered before sending httphandler request ). if ihttphandler request not isuued user, everythings works correctly , form cleared.

<input type="reset"  value="clearallfields" onclick="clearcontact()" />   <script type="text/javascript">    function clearcontact() {        ("form :text").val("");    } </script> 

you missed $ jquery before selector.

change

("form :text").val(""); 

to

$("form :text").val(""); 

your code be

<script type="text/javascript">    function clearcontact() {        $("form :text").val("");    } </script> 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -