This is a migrated thread and some comments may be shown as answers.

NumericTextBox - Blur Event

3 Answers 530 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jigar
Top achievements
Rank 1
Jigar asked on 10 Sep 2010, 11:41 AM
Hi There,

I wanted to set OnLostFocus event for the numerictextbox ( in my case it's currency text box); I did that like

var $NumericTextBox = $('#Amount');
$NumericTextBox.find('> #Amount-input-text').live('blur',function() { alert('hello'); })

On lost focus above event gets fired but it gets fired three times.

Can you please tell me why so? and how to prevent it?

Thanks,

Jigar.

3 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 10 Sep 2010, 12:48 PM
Hi,

I've tried something very simple:
  1. Opened this online demo.
  2.  Run this statement using FireBug:
$('#NumericTextBox-input-text').blur(function(){alert('blur');})

Blur event is raised only once. So in my opinion, this should work as expected on your side too.

Regards,
Peter
0
Jigar
Top achievements
Rank 1
answered on 10 Sep 2010, 12:58 PM
Hi Peter,


thanks a lot for your input. I do agree that blur event should be fired only once. I tried your suggestion but unfortunately didn't worked for me. It fired it three times. :(

Thanks a lot,

Jigar.
0
Jigar
Top achievements
Rank 1
answered on 10 Sep 2010, 04:06 PM
Hi,

I observed a new thing; It seems It attach this blur to all the numeric text box on the form.

As you can see in my sample code I posted, I mentioned the name of the text box; still it seems this blur event is being attached to all the enabled text boxes.

Regards,

Jigar.
Tags
NumericTextBox
Asked by
Jigar
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Jigar
Top achievements
Rank 1
Share this question
or