Skip to content

Infragistics Community Forum / Web / Ignite UI for jQuery / igTextEditor Blur Event Returns Previous Value Not Current

igTextEditor Blur Event Returns Previous Value Not Current

New Discussion
Karthikeyan Rajkumar
Karthikeyan Rajkumar asked on Aug 31, 2016 8:37 AM

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

Sign In to post a reply

Replies

  • 0
    Marina Stoyanova
    Marina Stoyanova answered on Aug 26, 2016 12:47 PM

    Hello Karthikeyan,

     

    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.

     

    Best Regards,
    Marina Stoyanova,
    Software Developer,
    Infragistics, Inc.

    • 0
      Karthikeyan Rajkumar
      Karthikeyan Rajkumar answered on Aug 30, 2016 12:42 PM

      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

      • 0
        Marina Stoyanova
        Marina Stoyanova answered on Aug 31, 2016 8:37 AM

        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.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Karthikeyan Rajkumar
Favorites
0
Replies
3
Created On
Aug 31, 2016
Last Post
9 years, 6 months ago

Suggested Discussions

Created on

Aug 31, 2016 8:37 AM

Last activity on

Feb 12, 2026 10:46 AM