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 426323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:28:05+00:00 2026-05-12T19:28:05+00:00

return false seems to work in the submitHandler but I’m not sure why. function

  • 0

“return false” seems to work in the submitHandler but I’m not sure why.

function submitHandler() {
    $.post($(this).attr('action'), $(this).serialize(), null, "script");
    return false;
}

$(document).ready(function () {

    $('#top_cat').submit(submitHandler);

    $("#tip_click").click(function() {
        $("#high_hat").submit(submitHandler);
    });

});

I’m also not sure if I need to add a “return false” in the #tip_click function so that it reads like this:

    $("#tip_click").click(function() {
        $("#high_hat").submit(submitHandler);
        return false;
    });

What’s the rule to follow here regarding when to “return false“?

  • 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-05-12T19:28:05+00:00Added an answer on May 12, 2026 at 7:28 pm

    You should return false when:

    • You want to prevent the default event action

      • The onsubmit event for example, the default action of this event is send the form data to the server, or an onclick event on an anchor element, the default event action is to follow the anchor’s HREF.
    • You want to stop the event bubbling.

    Returning false from an event handler, is like executing both event.preventDefault(); and event.stopPropagation();.

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

Sidebar

Related Questions

This is a piece of code on home.php <form action=./Login method=post> Email Address: <br
This question relates to my other post . Ok so after a bit more
I've been trying to create my own custom LiveValidation ( LiveValidation.com ) function that
I have a page that loads a div from another page on successful submission
In my app I'd like to show a warning when using a certain preference
I'd like to mimic html form behaviour using jquery. When clicking on a button,
There is problem with the following code. I am trying to Increase the dollar
when my ajaxupload script finishes it adds a read-only input w/ the value of
In my app, I handle numbers as BigDecimal and store them as NUMBER(15,5). Now
I'm trying to implement an octree, and for that, I need a fast AABB-ray

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.