jQuery - Cancel form submit (using “return false”?)?

后端 未结 12 1651
盖世英雄少女心
盖世英雄少女心 2020-12-19 04:00

I\'m running into a bit of trouble while trying to cancel the submit of a form. I\'ve been following this tutorial (even though i\'m not making a login script), and it seems

12条回答
  •  情深已故
    2020-12-19 04:35

    I had this same problem and it was down to using Rails and :remote => true on the form. Rails jQuery driver was coming in and submitting the form by ajax while my own function was trying to stall the submission process using return false and event.preventDefault().

    So look out for frameworks and default actions that interfere with your own javascript. return false should work :)

提交回复
热议问题