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

  • Home
  • SEARCH
  • 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 6374995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:33:27+00:00 2026-05-25T01:33:27+00:00

I have form where before i was using simple post with <button name=submit id=register

  • 0

I have form where before i was using simple post with <button name="submit" id="register" value="Register">Continue</button>

than i decided to change that post to jquery ajax post:

<script type="text/javascript">
    $(document).ready(function () {

        $("#register").click(function () {

            if (!$("form").valid())
                return false;

            var isContinue = false;

            $.ajax({
                url: "/Validate",
                type: "POST",
                dataType: "text",
                data: { recaptcha_challenge_field: $("input#recaptcha_challenge_field").val(), recaptcha_response_field: $("input#recaptcha_response_field").val() },
                cache: false,
                success: function (data, textStatus, xhr) {
                    isContinue = data === 'true';
                },
                error: function (xhr, st, err) {
                    alert("Sorry error occured, try again later.");
                },
                complete: function () {
                    alert(isContinue);//i could see that alert
                    if (isContinue) {
                        alert(isContinue); //i could see that alert
                        $("form").submit();
                        alert(isContinue); //i could see that alert
                    }
                    else {

                        return false;
                    }
                }
            });
        });
    });
 </script>
<a class="button" id="register">Continue</a

So if all validation including capthca passed than when i clicking to submit button and form does not posted on server. I checked request with chrome and opera network dev tools and they didn’t show that post action, but according with alerts which i placed in javascript the form should be posted.

Then for test i placed another simple submit button and form getting posted so for some reason $("form").submit(); don’t want to post the form.

May be some one may have any ideas what it could be?

UPDATE

I was commenting the ajax post button when i tried simple post button but the thing is
i was having another back button 🙂 which is looking like that:

<button name="submit" class="cancel" id="back" value="Back"> 

so the problem is really with name="submit", i just remove that and all working now.
It would take very long time to figure out that the problem just with name="submit", thanks for help.

  • 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-25T01:33:27+00:00Added an answer on May 25, 2026 at 1:33 am

    This is because the button you’ve named submit is overriding the submit method on the form element, so instead of form.submit being a function that submits the form, it’s now a reference to the button element.

    The easiest way of fixing this is to rename your button element.

    It’s important to differentiate between $('form').submit() and form.submit(). $('form').submit) is a jQuery method that is not affected by the button named submit, however behind the scenes, jQuery calls the submit attribute on the actual HTMLForm element, which is affected by the button named submit.

    There is a bug about this on http://bugs.jquery.com, however as described above, it’s not actually a problem with jQuery itself.

    You’re code has another problem; you shouldn’t be using $('form') inside your click handler, as this is building a jQuery object to alllll forms on your page; so you’re checking that alllll forms are valid, and submitting alll forms. Instead, use $(this).closest('form')

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

Sidebar

Related Questions

I have a very simple scenario where I want to POST the form using
I have an MVC form for adding a simple entity. I am using TextBoxFor(model
i have a form with 2 fields username: password: and a submit button. the
I have a form that contains a bunch of checkboxes. Before submitting the form,
I have a Django form that needs to do some client-side validation before submitting
In .NET, Windows Forms have an event that fires before the Form is loaded
I have form area in my view. If I click button A , I
I have form with one input for email and two submit buttons to subscribe
I have form with 1 button. when you click on the button 3 others
I have form with few buttons and I want to know what button is

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.