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
0
votes
1 answer

Fire TextChange method in .NET

I have two date pickers in my application. At page load the today's date is displayed in one text field(attached to a date picker) & the other has the date two days from now. What i want to do is, when a date is selected in the first date picker,…
Saku
  • 99
  • 2
  • 2
  • 6
0
votes
1 answer

data binding TextBox TextChanged is not working

I'm have two TextBoxes (XAML) And in the (.cs file) private MyModelContainer db; private…
Wassim AZIRAR
  • 10,823
  • 38
  • 121
  • 174
0
votes
1 answer

Updating listview android on textchanged StringIndexOutOfBoundsException

I'm having trouble with updating my listview ontextchanged. When I enter one letter works fine, but on the second letter the app crashes. What can be the problem? I've tested and the dolzina or length is correct but why on the second inserted…
Worker123
  • 595
  • 4
  • 13
  • 32
0
votes
2 answers

app is crashing while trying to replace whitspace

To remove white space from text i have written the below code.my requirement was to remove white space coming between the text while copy-pasting the text from same EditText(type "text" copy and paste it in same EditText.the text should be…
andro-girl
  • 7,989
  • 22
  • 71
  • 94
-1
votes
2 answers

SPQuery search doesn't work with "BeginsWith"

So, my problem is that my knowledge of CAML and Sharepoint is very poor. Question: I need SPQuery for building query search, search text I have from textbox. I expect that my query returns me item(s) (for example, I type in textbox "Jo" and query…
Viaches
  • 143
  • 1
  • 16
-1
votes
3 answers

Cancel the change of an entry Xamarin Forms

How can I cancel or delete the change of a value of an entry?
Aicha Maghrebi
  • 63
  • 2
  • 11
-1
votes
2 answers

Textbox with TextChanged event doesn't bring the date in second enter

I have a Textbox with TextChanged event working very well if I enter the correct id. But if I enter a wrong id and the MessageBox appears in catch section, and then I try to enter a correct id, it keeps giving me the MessageBox error. Here is my…
AzzaM
  • 1
  • 6
-1
votes
1 answer

How do I count number of characters into webbrowser control C#?

Using a webbrowser control. I'd like to count the number of characters into webbrowser, just like textchange of Textbox class. I just want to count the number of characters in the text that display WebBrowser no html, no images, etc.Any idea about…
-1
votes
5 answers

Only one "0" before "." in textBox_TextChanged

How can I left only one "0" before "."? I'm making TextBox which accepts only digits and you can write only one "0" before ".", but you can write any numbers like 900 or 5000. Here is the pseudocode I use: if (0 > 1 before "." && 0 is first digit)…
Ovidzikas
  • 113
  • 11
-1
votes
1 answer

enable button when certain textboxes has information

This question has been asked but not to this extend I have 8 textboxes, and a button which is disabled on form_load.. 4 of the 8 textboxes are required to be filled before the button can be enabled... How do I check that…
-1
votes
1 answer

How to efficiently determine if the user has actually produced input in C#

Working on a text editor here... I'm trying to figure out if the user has actually caused any changes in a textbox after a keyboard event has occurred. Obviously if they press a standard keys like, A B C, it will fire, but I'm more interested if…
David
  • 4,744
  • 5
  • 33
  • 64
-1
votes
1 answer

textchanged event calling custom method but custom method reports textbox text is empty

I've not touched C# in some time, was trying to help a new programmer friend of mine and became utterly stumped by the following: private void textBox1_TextChanged(object sender, EventArgs e) { activateEnterButton(); TextBox…
ross studtman
  • 936
  • 1
  • 8
  • 22
-1
votes
3 answers

TextChanged event is not firing in web application

In the below code i have been working on asp.net web application .in my case the textchange event is not firing.Pls help me to solve the issue. code: public delegate void LeavingFocusHandler(int CurrentIndex); public event LeavingFocusHandler…
user3224577
  • 37
  • 1
  • 1
  • 9
-1
votes
3 answers

Auto refresh labels as text boxes text input data into method

Here is my method that I' am trying to have automatically refresh my label. When I have my label as a click event...the answer refreshes and is correct. private void Calculate() { dblUtil1 = Tinseth.Bigness(dblSG) * Tinseth.BTFactor(dblBT1); …
growthtek
  • 21
  • 1
  • 5
-1
votes
1 answer

dynamic search in file using c#

/*I am reading many files and getting data through File.ReadAllLines. Now I want to search in these files for a specific string written in a textbox. Whenever I put some text in the textbox it must return lines of text containing that word. I am…
Fun Haha
  • 1
  • 1
1 2 3
19
20