Prevent submit button with onclick event from submitting

后端 未结 5 1685
一向
一向 2020-12-17 10:21

I want to prevent a submit button with onclick event from submitting:

$j(\'form#userForm .button\').click(function(e) {
    if ($j(\"#zip_field\").val() >         


        
5条回答
  •  孤街浪徒
    2020-12-17 10:49

    Basically, if you change your button type from type="submit" to type="button", such button won't submit form, and no workarounds are needed.

    Hope this helps.

提交回复
热议问题