Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7827221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:46:08+00:00 2026-06-02T09:46:08+00:00

Using the .NET Windows Forms WebBrowser control to show the preview of a page,

  • 0

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 page:

$(function() {
    $('a').click(function() {
        $(this).attr('href', 'javascript:void(0);');
    });
});

Since the HTML page I want to show as the preview also contains HTML forms, I’m looking for a similar approach to disable all form submit functionality.

I’ve tried:

$(function() {
    $('form').attr('onsubmit', 'return false');
});

But it seems that this doesn’t work (read: “still loads the page”) for a form like:

<form id="myform" name="myform" onsubmit="return search()" action="">

which I have on the page.

So my question is:

What is the best way to disable all form submit functionality on a HTML page, no matter whether it is a GET or a POST form?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T09:46:15+00:00Added an answer on June 2, 2026 at 9:46 am

    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 ).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Had a Windows Forms app using a WebBrowser control (.NET 4) to load a
I am using the WebBrowser control on a Windows Forms application in Visual Studio
i am using the WebBrowser control in asp.net page. here is the simple code:
I want something like this develop using C# .net for Windows Forms. (ListView Details
I have previously written user interfaces using .NET and Windows Forms. I'm about to
I'm using .NET 2.0 Windows Forms and want to add drawing components such as
I have been experimenting with sending messages from two .NET Windows Forms applications using
Case : I'm creating a desktop application with VB.NET (Windows Forms), and using SQL
I am building a Web Application using asp.net (C#). I come from windows forms
We have a fairly complicated GUI in windows forms using C# and .Net 2.0.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.