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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:53:17+00:00 2026-05-27T22:53:17+00:00

I have an html form and some jQuery that validates the form. If all

  • 0

I have an html form and some jQuery that validates the form. If all of the validations pass I would like to submit the form. When I press submit, the errors messages are appearing (if there are errors), however, when there are no error messages, the submit button kind of stalls and I get an error

Unresponsive script error

I get the same results in both firefox and safari.

jQuery (the errors div is where all of the errors appear):

$("#joinForm").on("submit", function (e) {
        e.preventDefault();

        if (!$(':text').val() || !$(':password').val()){

            $('#fillIn').remove();
            $('#errors').append("<p id='fillIn'>Please fill in all fields</p>");
        }
        else {
            $('#fillIn').remove();
        }


        if ($('#email').val()!= $('#reemail').val()){
            $('#noMatch').remove();
            $('#errors').append("<p id='noMatch'>Emails do not match</p>");
        }
        else{
            $('#noMatch').remove();
        }


        if ($('#email').val() == $('#reemail').val() && $(':text').val() && $(':password').val()){
            $('#joinForm').submit();
        }
        else{
            $('#errorModal').modal('show');
        }

    });

});

HTML:

<form method='POST' action='join_action.php' id='joinForm'>
    <table>
        <tr>
            <td>Full Name: </td><td><input type='text' name='name'></input></td>
        </tr>
        <tr>
            <td>Email: </td><td><input type='text' name='email' id='email'></input></td>
        </tr>
        <tr>
            <td>Re-type Email: </td><td><input type='text' name='reemail' id='reemail'></input></td>
        </tr>
        <tr>
            <td>New Password: </td><td><input type='password' name='password'></input></td>
        </tr>
        <tr>
            <td><input type='submit' value='Sign Up' name='signup' id='signup'></td>
        </tr>
    </table>
</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-05-27T22:53:18+00:00Added an answer on May 27, 2026 at 10:53 pm

    The e.preventDefault(); prevents the form from submission, and then you called submit() manually, this will fire another submit event, thus you got an infinite loop.

    To fix it, call preventDefault only when the form is invalid.

    $("#joinForm").on("submit", function (e) {
            var isValid = true;
    
            if (!$(':text').val() || !$(':password').val()){
                isValid = false;
                $('#fillIn').remove();
                $('#errors').append("<p id='fillIn'>Please fill in all fields</p>");
            }
            else {
                $('#fillIn').remove();
            }
    
    
            if ($('#email').val()!= $('#reemail').val()){
                isValid = false;
                $('#noMatch').remove();
                $('#errors').append("<p id='noMatch'>Emails do not match</p>");
            }
            else{
                $('#noMatch').remove();
            }
    
    
            if (isValid && $('#email').val() == $('#reemail').val() && $(':text').val() && $(':password').val()){
               // pass
            }
            else{
                $('#errorModal').modal('show');
                e.preventDefault();
            }
    
        });
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form with some plain html input like bellow using ASP.NET
I have an asp.net form that contains some html, 2 controls a calendar from
There are some HTML based games (ie bootleggers.us) that have a simple login form
I have created some JQuery that on click of specified HTML it then becomes
I have a simple HTML Form that allows the user to enter some text
I have a form that validates using jquery. The form's id is contact and
I have an HTML form with some radio buttons like these: <form action =
I have a simple html form and some php that input the POST variables
If I have a HTML form with some embedded div s, and after the
I have a HTML form, and I have a Controller Action that accepts the

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.