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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:24:27+00:00 2026-05-15T20:24:27+00:00

Why does the onchange event of my textbox fire on blur, but does not

  • 0

Why does the onchange event of my textbox fire on blur, but does not fire by every typed character ?

I want to get the entire entered text in textbox by every type by keyboard!

But onchange event only is fired on blur!

Besides onkeyup - onkeypress - onkeydown events do not help because at first these events fire and then last entered character is applied to the textbox.

What event should I use or how can I do that?

  • 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-15T20:24:27+00:00Added an answer on May 15, 2026 at 8:24 pm

    you want keyup, keydown, or a combination of them. during the keydown handler, you can get the before-event value of the textbox. during the keyup handler, you can get the after-event value. if you’re getting an empty string you’re doing something wrong.

    edit: here’s an example demonstrating how these 2 events works. typing in the first box updates the other two.

    <table>
        <tr>
            <td>input</td>
            <td><input type="text" id="textin" /></td>
        </tr>
        <tr>
            <td>keydown</td>
            <td><input type="text" id="keydownout" /></td>
        </tr>
        <tr>
            <td>keyup</td>
            <td><input type="text" id="keyupout" /></td>
        </tr>
    </table>
    <script>
    
        var readbox = document.getElementById('textin');
        var keydownbox = document.getElementById('keydownout');
        var keyupbox = document.getElementById('keyupout');
    
        function keydownhandler(e) {
            keydownbox.value = readbox.value;
        }
    
        function keyuphandler(e) {
            keyupbox.value = readbox.value;
        }
    
        readbox.addEventListener('keydown', keydownhandler, false);
        readbox.addEventListener('keyup', keyuphandler, false);
    
    </script>
    

    (works in firefox/chrome)

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

Sidebar

Related Questions

I have a textbox with an onchange event. Why does this event not fire
The onchange event for a HTML input box does not fire until the textbox
My OnChange event does not work properly - I want to trigger a function
I just found out that onchange event does not bubble in MSIE. I hopped
onChange event does not include a reference to the grid. Almost all of the
I want to call twoJS functions on onchange event and both functions returns some
I want to call a JSON method on my textbox change event using jquery.
Does SqlDependency (for example) fires the OnChange event, when the invocation of previous event
I have an onChange event that keeps bringing up the error below whenever I
I need to detect the id of the element that generated an onchange event.

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.