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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:12:43+00:00 2026-06-01T04:12:43+00:00

I have a text box that accepts integers, and I need it to run

  • 0

I have a text box that accepts integers, and I need it to run a function that will use the text box’s input, as soon as a user inputs numbers into the field.

The problem here is that keyUp() will detect each and every input. So if I type 23, it will fire once for 2 and once for 3. I only need it to run when the input is complete.

Is there a way to do this, without losing focus and without using a timer that will keep checking the text box input every while using setInterval?

  • 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-01T04:12:49+00:00Added an answer on June 1, 2026 at 4:12 am

    Look like you want to be notified when the user stops typing. The following code can be used as a starting point, it calls bufferedKeyUp 300 ms after the user stops typing. http://jsfiddle.net/mendesjuan/VTMEe/

    $(function() {
        // Creates a handler that will wait until the event hasn't fired for a period 
        // before it fires the actual event handler
        function createBuffered(fun, delay) {
            var timer;
            return function() {
                clearTimeout(timer);
                var args = arguments;
                var me = this;
                timer = setTimeout(function() {
                   fun.apply(me, args);
                }, delay);        
            }
        }   
    
        $('#in').keyup( createBuffered(function(){
            console.log('change');
        }, 300));
    });​
    

    Ext-JS has a nice simple way to do this http://jsfiddle.net/mendesjuan/DYkmU/1/

    Ext.get('myid').on('keyup', function() {
      console.log('change');
    }, null, {buffer: 300});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a text box that the user can type in that
I want to have a small text box with a scroll bar that will
I have received requirements that ask to normalize text box content when the user
I have an ASP.NET user control that contains a text box control and a
I have the text box which only accepts number and dot so that i
I have a text box that is going to be populated with a comma
I have a C# form that has a text box that needs to constantly
The project I am working on has a rich text box that can have
I have a 2GB text file on my linux box that I'm trying to
I have a UI with a search text box and a button that that

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.