Questions tagged [textchanged]

An event that occurs when the text/content of a UI element has changed.

Definition:

The TextChanged event is an event that occurs when the text or content of a UI element has changed.

Most of the time this will be the text/content of a textbox. In general this event is not bound to a specific language or framework. The event can be captured in .NET, JAVA, JavaScript, ...

Examples:

  • .NET

    • WindowsForms

      TextBox _nameTextBox = new TextBox();
      _nameTextBox.TextChanged += new EventHandler(NameTextBox_TextChanged);
      
      private void NameTextBox_TextChanged(object sender, EventArgs e)
      {
          //Handle event
      }
      
    • WPF

      <TextBox TextChanged="MyTextBox_TextChanged">Default text</TextBox>
      
      private void MyTextBox_TextChanged(object sender, TextChangedEventArgs args)
      {
          //Handle event
      }
      
  • JAVA

    JTextField nameTextField = new JTextField();
    
    nameTextField .getDocument().addDocumentListener(new DocumentListener() {
    
        public void removeUpdate(DocumentEvent e) {
        }
    
        public void insertUpdate(DocumentEvent e) {
        }
    
        public void changedUpdate(DocumentEvent e) {
        }
    }); 
    
  • HTML/JavaScript

    <input type="text" id="name" onchange="nameChanged()">
    
    function nameChanged() {
        var name = document.getElementById("name");
        //Handle event
    }
    

More reading:

287 questions
3
votes
2 answers

Checking that value of ui elements has been changed

Is there any way to check that the ui elements(line edit,combo box,etc.) of the dialog has been changed. What I want is to show a message to the user if he changes the value of any single ui element, saying that details have been partially…
krohit
  • 792
  • 1
  • 7
  • 26
3
votes
3 answers

why autocomplete textbox textchange event not firing?

I have a textbox with ajax jquery autocomplete feature.but the textchange event is not firing. Autocomplete function: …
sona
  • 1,552
  • 3
  • 18
  • 37
3
votes
1 answer

Is there a way to clear a TextBox's text without TextChanged firing?

In my application I'd like to handle TextBox input in certain cases (some criteria is not filled, for example) and because KeyDown is useful only for keyboard input but not actual pasting from the clipboard (I wouldn't want to go through the trouble…
Dimitris Iliadis
  • 2,269
  • 2
  • 15
  • 15
3
votes
2 answers

Android TextView Number Animation

I have a textview with numbers in it. If the number was changed, i want to animate this. But this shouldn't be a fade in and fade out effect. I want to animate every single number with a vertical flip effect. Is that possible?
Zenco
  • 2,963
  • 3
  • 17
  • 22
3
votes
1 answer

Changing characters in an EditText while typing? Android

I currently have an app that is using a timer of sorts and I have an edit text that changes the time. I would like to add a feature that automatically inserts a colon or period after a certain number of characters has been typed in as the syntax for…
user3078867
  • 81
  • 1
  • 8
3
votes
1 answer

Is it possible to textchanged event to occur only when textBox is focused?

I have method like this. public void CheckEmployee() { ConnectionStringSettings myConnectionString = ConfigurationManager.ConnectionStrings["LibrarySystem.Properties.Settings.LibraryConnectionString"]; using…
Karlx Swanovski
  • 2,869
  • 9
  • 34
  • 67
3
votes
2 answers

Jquery .change() function doesnt`work on localhost

The following code works on jsfiddle but does not work on localhost, can you help me please?