Forum Discussion
christopher_gillis
8 years agoCommunity Manager
Hello,
It looks like in 11.0 SP12, the onChange event is called just before the change to the dropdown is actually set. In order to access the value, I'd recommend setting a timeout with a very small duration and looking up the value in there like the example below.
Christopher Gillis Aras Labs Software Engineer
setTimeout(function() {
var value = getFieldByName("z_prefix").getElementsByTagName("input")[0].value;
}, 10); // <-- 10ms worked in my test environment, but you may find you need to increase the duration of this timeout
I would have filed this behavior to be fixed, but it seems this has already been updated in the recently released 11.0 SP15 which is available to subscribers. In SP15, you can simply call this.value without the timeout in order to retrieve the new value in an onChange event.
Chris
Christopher Gillis Aras Labs Software Engineer