Disable submit functionality for all forms on a HTML page

前端 未结 8 1471
轻奢々
轻奢々 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:56

    Use this:

    <form id="myform" name="myform" onSubmit="search();return false;" action="">
    
    0 讨论(0)
  • 2021-01-02 01:06

    You can either disable the submit buttons

    $('form :submit').attr("disabled", "disabled");
    

    or just make the submit event do nothing

    $('form').submit(function(e){ e.preventDefault(); });
    

    It depends what exactly are you trying to achieve.

    0 讨论(0)
提交回复
热议问题