I have an Asp.net AJAX control and in client control class I want to handle the onFocus event for some textboxes in my control. I would like to have only one handler for all the textboxes, however in the handler I don't know how to get the source element that caused the focus event.
In my initialize function I will have the following code for each text box:
this._onfocusFunctionDelegate = Function.createDelegate(this, this._onFocus);
$addHandler(this._textBox1, 'focus', this._onfocusFunctionDelegate); //repeated for each textbox
in the _onFocus handler I want to be able to determine which textbox fired the event and call select() for that textbox.
_onFocus: function(evt) {
// how do I get the source element? The following doesn't work
evt.srcElement.select(); }
So how do I figure out what element fired the event?