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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:25:42+00:00 2026-05-13T22:25:42+00:00

I have a textbox and want an event triggered whenever it is updated, whether

  • 0

I have a textbox and want an event triggered whenever it is updated, whether through key presses, pasted from clipboard, or whatever else is possible.

Is binding to the keyup event sufficient or is there a better way?

  • 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-13T22:25:42+00:00Added an answer on May 13, 2026 at 10:25 pm

    I did the same thing in a text field with this code:

    $(document).ready(function(){
    
        $('#link').keyup(function(event){       
    
            if($(this).val().length > 30 && this.value != this.lastValue){
                if (this.timer) clearTimeout(this.timer);
    
                if(!$('#ajax-aguarde').length)
                {
                    $('<p id="ajax-aguarde"></p>').appendTo($('#link-element'));
                }
                $('#ajax-aguarde').html('Wait, loading...');
    
                if($('#posts').length){
                    $('#posts').remove();
                    $('#p-ultimos').remove();
                }
    
                str = this.value;
                url = $('#ajaxurl').val();
    
                this.timer = setTimeout(function () {
                    $.post(
                    url,
                    { link: str, format: 'json' }, 
                    function(data){
    
                        if(data.error == 1){
                            $('#ajax-aguarde').html('Error...');
                        } else {
                            $('#ajax-aguarde').remove();
                        }
    
                        if(data.titulo.length){
                            $('#titulo').val(data.titulo);
                        }
                        if(data.descricao.length){
                            $('#descricao').val(data.descricao);
                        }
    
                        $('<p id="p-ultimos">Last posts:</p>').appendTo($('#link-element'));
                        $('<ul id="posts"></ul>').appendTo($('#link-element'));
    
                        $.each(data.posts, function(index, post) { 
                            $('<li id="post' + index + '"></li>').appendTo($('#posts'));
                            $('#post' + index).html(post.title);
                        });
    
    
                    },
                    "json"
                    );
                },1000);
    
                this.lastValue = this.value;
            }
    
        });
    
        setTimeout(function() { $('#link').keyup(); },500);
    });
    

    I have setTimeout to ensure some events that did not get triggered

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

Sidebar

Related Questions

I have a textbox, when textchange event fired, I want to compare the old
I have a textbox in my form. On the form load event, i want
I have a textbox whose value I want to set based on the inner
I have an asp:TextBox and I want to validate that the number of characters
C# question: I have a textBox in a default form Form1 and I want
I have a TextBox and a Popup control. I want the Popup.IsOpen property to
I have a textbox and a regular expression validator applied to it. I want
I have two CheckBoxes and a TextBox. I want to TextBox to have IsEnabled=False
I have a standard textbox and I've got jQuery on the page. I want
i have a username textbox and a password textbox in the webpage. i want

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.