Code :
$("#textEditor").igTextEditor({ width: 160, nullText: "Enter Text", blur: function (evt) { alert("blur : " + $("#textEditor").igTextEditor("option", "value")); } });
Step 1: Enter value as "1" in textbox and click outside, now blur event will trigger in that i get textbox value as "Null".
Step 2: Enter value as "2" in textbox and click outside, now blur event will trigger in that i get textbox value as "1".
Step 3: Enter value as "3" in textbox and click outside, now blur event will trigger in that i get textbox value as "2".
I do not know how to get the current entered value when Blur event triggers. can anyone help me.
I'm able to get the current entered value in "valueChanged" event, but i want that to to happen when control losses the focus(blur) kind of it.
Thank you
Hello Karthikeyan,
Thank you for clarifying your case.
The valueChanged event is triggered after the blur event and that is why when you call the value method during the blur event, the value is still not changed. What you can do as a workaround is add custom logic and attach an event handler to the input itself for jQuery blur event. Please note, that as browsers can trigger events in different order this workaround may not work every single time. You can set a timeout for that purpose and thus you will provide enough time for the value to be changed.
Best Regards, Marina Stoyanova, Software Developer, Infragistics, Inc.
Hello Marina,
Thank you for your reply, my scenario is "Whenever the control lose focus, event should get triggered and i should be able to get new value". I already tried valueChanged event but that event will not help me out for my scenario.
Thank You
Karthikeyan Rajakumar
Thank you for contacting us.
The reason for this behavior is that the event is triggered during blur and the new value is not yet assigned to the editor. That is why I recommend you to use the valueChanged event. In order to trigger the valueChanged event you will have to lose focus so I believe this event should work for you. If not please share more details about your scenario so I can provide you a better support.