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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:23:42+00:00 2026-05-26T09:23:42+00:00

I have a zip code resolver and I’m using a keyup event handler to

  • 0

I have a zip code resolver and I’m using a keyup event handler to track when the length of the input reaches 5 then query the server to resolve the zip code. But I want to keep the script from being unnecessarily being called, so I was wonder if there were a way to track a keydown event and stop the keyup event when there is already 5 characters in the textbox (which would indicate that a query has probably already been submitted), if there were a way to stop the keyup event handler after? I know this is kind of a weird question so feel free to ask questions. Here kind of a layout of what I’m talking about:

$('#zip_resolver').live('keydown', function(event){
    if($(this).val().length==5){
        //STOP KEYUP EVENT
    }else{
        //DO NOTHING
    }
});
$('#zip_resolver').live('keyup', function(){
    if($(this).val().length==5){
        //SEND RESOLVE REQUEST
    }
});
  • 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-26T09:23:42+00:00Added an answer on May 26, 2026 at 9:23 am

    You can just enforce that the keydown was 4: http://jsfiddle.net/rkw79/H7PhT/1/

    $('#zip_resolver').live('keydown', function(event){
       wasfour = (4 == $(this).val().length);
    });
    $('#zip_resolver').live('keyup', function(){
        if($(this).val().length==5  && wasfour){
            //SEND RESOLVE REQUEST
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code to zip all the files and then save it
I'm using monorail, activerecord, and jquery. I have a form with a zip code
I have a very small form where a user can enter their zip code
I have inherited some code (from zip file) from a developer and git initialzed,
I have the following code for adding to/extracting from Zip. I'm trying to refactor
I have this code in the end of link button click: Response.ContentType = application/zip;
I have .zip file which contain csv data. I am reading .zip file using
I have an addresses table with ZIP code field which has type VARCHAR. I
In my MySQL InnoDB database, I have dirty zip code data that I want
I have a field that represents a zip code of a user. When 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.