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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:13:53+00:00 2026-05-31T09:13:53+00:00

I have a for that I am submitting with this button: <button id=registerButton type=submit

  • 0

I have a for that I am submitting with this button:

<button id="registerButton" type="submit" name="submit" style="margin-left: 300px;">Click to Complete</button>

I am doing error checking with this jQuery:

$('#registerButton').bind('click',function(){
    if($('#formElem').data('errors')){
            alert('Please correct the errors in the Form');
            return false;
        }
});

When I go to submit the form it will pop up with the alert if there are errors detected on the form. However, if there are no errors the button doesn’t do anything. What am I doing wrong?

  • 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-31T09:13:55+00:00Added an answer on May 31, 2026 at 9:13 am

    Bind the validation on the submit event of the form.

    $("#formid").submit(function(e) { 
        if($(this).data('errors')){
            //display error
            e.preventDefault(); //stop the submit
        } else {
           //do something or nothing
           //but it will submit the form
        }
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following markup: <select multiple=multiple id=targetFilesList style=width:200px;height:110px;> </select> <input type=button value=Get id=btnGet
I have the following HTMLHelper extension to create a submit button that would work
Say I have: <form method=get action=something.php> <input type=text name=name /> </form> <input type=submit />
I have a form, when the user clicks on the submit button this javascript
i have a button in my app a button that submit score to gamecenter
I have a form submit button that I need to enable the user to
I'd like to have a submit button that submits a different value than is
I have a form that I'm submitting with AJAX. A user fills out the
I have a form that contains a bunch of checkboxes. Before submitting the form,
I have a page that contains several forms, by submitting each one of them,

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.