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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:24:13+00:00 2026-05-23T01:24:13+00:00

In my form I have a normal submit button which validate my form with,

  • 0

In my form I have a normal submit button which validate my form with, for example, I have

$("#formTest").submit(function (e) {
        alert('test');
});

<form id="formTest">
    <input type="text"/>
    <button>Test</button>
    <input id="submitButton" type="submit" value="Save" />
</form>

But when I click on the “Test” (not the “Save” button) the alert() is displayed.
Here is a simple exemple, but in my case, jQuery validate all my input in this case.

How I can have a button with no submit effect?

Than You

  • 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-23T01:24:14+00:00Added an answer on May 23, 2026 at 1:24 am

    Basically this has nothing to do with validation. This is just pure form submission. To prevent your form brom being submitted on your Test button click, you should attach a click event handler to it and cancel event’s propagation.

    $("button").click(function(evt){
        evt.preventDefault();
        return false;
    });
    

    Why does this happen anyway?

    The thing is that when you click your Test button, your form gets submitted because default button type (when not provided as in your case) will be submit. Check W3C Specification.

    This simply means that by providing a type="button" would change this submission behaviour as well. But this depends on the problem at hand (which is clearly not the one presented in the simplified example).

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

Sidebar

Related Questions

If you have a normal form: <form method='post' action='#'> <input type='text' name='#' /> <input
I have a form element and that has a normal submit button but I
I have a form that has three submit buttons as follows: <input type=submit name=COMMAND
I have a little problem with jQuery: $('#form-submit').click(function () { $('#textarea, #name').removeClass('error-state').addClass('normal-state'); var myName
I have a form in which the Submit button does not sit within the
I have form with one input for email and two submit buttons to subscribe
i have a page, which has 2 links (search, normal button), both redirects are
I need to have multiple submit buttons. I have a form which creates an
Is it normal for the Submit button to show in $_POST data? I have
I have a login form for my website. This login form have two text

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.