05-26-2009 03:15 PM - edited 05-26-2009 04:19 PM
Currently researching Blackberry Browser software solution and have found an issue. I am creating a html input text via asp.net and attach an onchange event to the list. Upon onchange I simply want to display the id of the text box that generated fired the onchange
alert(Event.currentTarget); = empty alert
alert(Event.currentTarget.id);= no alert. I assume an exception is thrown behind the scence.
Anyone from RIM care to comment? How can I get the id of the element that triggered the event? The preferred method would be W3C compliant.
Solved! Go to Solution.
05-26-2009 11:41 PM
05-27-2009 08:08 AM
Using an external js file this seems to work. elementId is a global var in the js file.
<input name="bla" type="text" id="bla" onchange="elementId=this.id; someObject.method();" value="7.00" />
That being said I don't like this solution. I agree e.currentTarget would be the best approach e doesn't exist in the BB. Am I missing something?
05-27-2009 12:25 PM
I would pass the id in the method parameter.
I'm not sure that the event.currentTarget.id would work for a text box, I don't think this method works in IE.