JQuery Validate - class=“cancel” submit button only stops validation once

前端 未结 2 1282
陌清茗
陌清茗 2021-01-27 04:25

I have a form with buttons I do not what to Submit the form, but they are (necessarily) submit buttons. I\'ve given them the class \"cancel\" and on the first click they are can

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-27 04:55

    Why not just have a cancel function?

    Change your button to be something like

     
    

    And then add a listener to it with jQuery

    $(function() {
         $("#Pet3btncat").live('click',function() {
                $('#myform.input').html('');
         });
    });
    

提交回复
热议问题