function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gautam Maheshwari 19Gautam Maheshwari 19 

event.target.value not working after enabling lockerservice

Hi All,

event.target.value not working after enabling lockerservice in lightning.
Can you guys help me with this? Thanks
Andy NormanAndy Norman
If the source of the event is a Lightning component, try:
 
event.getSource().get('v.value')

If the source of the event is a plain HTML element:
 
In .cmp
<button id="{!globalId + '_mybutton'}" onclick="{!c.ButtonClick}" >Button</button>

In JS controller:

ButtonClick: function (component, event, helper) {
  var target = document.getElementById(component.getGlobalId() + "_mybutton");
}

Maybe there are better ways to do it, but that is how I'm doing now the LockerService changes are enabled on an org I am releasing to, I'm still getting to grips with fixing what is broken by the LockerService.