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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:53:33+00:00 2026-06-13T02:53:33+00:00

As soon as I insert errorPlacement: function, it breaks the code. No validation happens

  • 0

As soon as I insert errorPlacement: function, it breaks the code. No validation happens on click of submit. can someone help please.

If I remove this function, validation works fine.

Imports:-

<script type="text/javascript" src="/MyApp/js/jquery.js"></script>
<script type="text/javascript" src="/MyApp/js/jquery.validate.min.js"></script>

Script:-

    $(document).ready(function(){
        $("#post-an-ad").validate({
            rules:{
                articleTitle:{
                    required: true,
                    minlength: 5
                },            
                dateRequested:{
                   required: true,
                    date: true
                },
                articleLocation:{
                    required: true,
                    minlength: 8
                },
                'user.agent': "required",
                'user.firstName': "required",
                'user.emailId':{
                    required: true,
                    email: true
                },
                'user.phone':{
                    required: true,
                    minlength: 8,
                    number: true
                }
            },
             errorPlacement: function(error, element) {
             alert("This alert is not popping");
             },
            submitHandler: function(form){      
            // doing nothing on a submit.
                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-06-13T02:53:35+00:00Added an answer on June 13, 2026 at 2:53 am

    I put your code into a jsFiddle and it crashed my browser. Your Validation code is fine… however, putting an alert() inside the errorPlacement: function is not!

    errorPlacement: function(error, element) {
        alert("This alert is not popping");  //--- this is causing infinite loop
    },
    

    Alert is triggered on error, then when you hit “ok” on alert it’s re-triggered immediately since the form is still invalid, the process repeats… this gets stuck in infinite loop of non-stop alerts. It crashed my Safari because I could not dismiss alert without next alert popping back immediately. I’m sure other browsers are handling this loop in their own way.

    Everything else is working fine.

    Un-comment the offending lines at your own risk:

    http://jsfiddle.net/59bsp/


    This is the solution where errorPlacement: works perfectly fine…

    errorPlacement: function(error, element) {
        error.insertAfter(element);  //- this line demonstrates the default behavior
    },
    

    http://jsfiddle.net/59bsp/1/

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

Sidebar

Related Questions

I'm hoping that someone can help me with this issue. I've been racking my
I have an application that dynamically insert VBA code to help building a MS
I tried to insert a set of rows as soon as a table is
Going back to the errorplacement solution by Nadia ( jQuery override default validation error
I use the code below to insert data into my sqlite-database but for some
I'm on an sql2000 (2008 coming soon, yay!) so I can't use the merge
Problem Definiton:- I need to insert some values into Database as soon as all
I have an meta_box in the post creation screen. As soon a user click
I am developing a website and got a database where people can insert data
Using the code # the data we want to insert $data = array($first_name, $last_name,

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.