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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:24:31+00:00 2026-06-07T21:24:31+00:00

So, I have a working version of this here: http://jsfiddle.net/yEmvm/19/ When you click on

  • 0

So, I have a working version of this here: http://jsfiddle.net/yEmvm/19/

When you click on the company of the first address block and then click on the name it fires the event and says invalid address. I don’t want to fire that event until I cilck on company for the second address block or anywhere outside that first address block. I cannot figure out another event to trigger this on.

This is just an example. This page will contain an unknown number of address blocks from 3 to 99. Also, it will contain many more fields for a full address. The user can keep adding more with a button. However, class and id name structure is consistent.

  • 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-07T21:24:33+00:00Added an answer on June 7, 2026 at 9:24 pm

    You should run your code in a timeout, and cancel timer on focus:

    $('.address').each(function()
    {
        var timer;
    
        $(this).find('input').blur(function()
        {
            timer = setTimeout(function()
            {
                var verified = false; // run your verification here
    
                if ( ! verified )
                {                
                    // run code here to display error
                }
            }, 0);
        })
        .focus(function()
        {
            timer && clearTimeout(timer);
        });
    });​
    

    Here’s a very basic example: http://jsfiddle.net/U6TRj/3/


    Explanation:

    Basically, if you’re clicking on an input element while being focused on another input, the browser will first fire the blur event on the old element, then the focus event on the new element.

    What we’re doing here with the timeout (no delay required), is pushing the execution of the code down the stack, so that it executes after the focus event handler. That way, we can cancel it’s execution from within the focus callback.

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

Sidebar

Related Questions

I have posted a working version here: http://jsfiddle.net/JV2qW/2/ I have a textarea that updates
I finally got some parts working here: http://jsfiddle.net/trXBr/5/ but when I put the code
Good Day all, i have been working with http://jsfiddle.net , the sample app i
Currently, I have this version of the autocomplete control working when returning XML from
Here is a simplified version of what I have (not working): prog.h: ... const
I have a working version of tooltip (jQuery Tools - http://flowplayer.org/tools/demos/tooltip/index.html ) , jQuery(document).ready(function()
I use TortoiseSVN for version control. In a working cooy I have been working
I have just begun working on a project which uses Mercurial as a version
I have Git (version 1.7.2.5) bash compeletion working on my Debian squeeze (6.0). Git
I have installed the latest version of netbeans and its working.. I have opened

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.