Disable submit functionality for all forms on a HTML page

前端 未结 8 1532
轻奢々
轻奢々 2021-01-02 00:04

Using the .NET Windows Forms WebBrowser control to show the preview of a page, I\'m using the following approach described in this SO posting to disable all links on the pag

8条回答
  •  暖寄归人
    2021-01-02 00:52

    You should be able to do:

    $('form').submit(false);
    

    From the jQuery documentation:

    In jQuery 1.4.3 you can now pass in false in place of an event handler. This will bind an event handler equivalent to: function(){ return false; }. This function can be removed at a later time by calling: .unbind( eventName, false ).

提交回复
热议问题