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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:45:15+00:00 2026-06-14T04:45:15+00:00

I have a small jQuery function which collects data from the server depending on

  • 0

I have a small jQuery function which collects data from the server depending on a zipcode input field:

$(document).ready(function(){
  $('#id_zipcode').keyup(function() {
    var selected = this.value;
    if (selected.length > 3) {
        $.getJSON(get_zip_factors_url, {
            zipcode: selected
        }, function(env_data, jqXHR) {
            $('#snow_fall').html(env_data[0].snow);
            $('#wind_speed').html(env_data[0].wind);
        });
    }
  }).keyup();
});

This works fine now. However, if the user deletes characters the values rendered for #snow_fall and #wind_speed persist. Is there some way I can register this deletion and revert the values to say a ‘not available’ string when the user deletes characters which result in no valid data being returned from the server?

Any help much appreciated.

  • 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-14T04:45:17+00:00Added an answer on June 14, 2026 at 4:45 am

    If you’re looking for zip code values why not change to if(selected.length == 5) and then use the else of the if statement to set snow_fall and wind_speed to “not available”?

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

Sidebar

Related Questions

I have a small jQuery function which I am using to capture the input
I have a jquery function that is called on $(document).ready that modifies the css
I have this jquery code which works great: $(document).scroll(function(){ if ($(this).scrollTop()>175){ // animate fixed
Hi I am learning JQuery and I have written a small function where I
I have a number of small icons which are draggable via jQuery which i
I have a small problem with jQuery $.ajax() function. I have a form where
I have a small jQuery snippet which animates an image caption, based on the
I have a small ajax jquery script which returns some XML for me. Whilst
I have code like this: $(document).ready(function () { $('.accessLink') .bind('click', accessLinkClick); $('#logoutLink') .click(function (e)
I have a small problem in my code. I have a function, which require

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.