<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Selected Drop Down value with onChange</title><link>https://www.aras.com/community/f/development/3988/selected-drop-down-value-with-onchange</link><description>Hello,

I have a Drop Down (z_prefix) that contains a list of values that the user selects from. The section is then used as a prefix for a manually entered description in a text box (z_description).

using this returns the previously selected value in</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Selected Drop Down value with onChange</title><link>https://www.aras.com/community/thread/2189?ContentTypeID=1</link><pubDate>Tue, 23 Oct 2018 02:55:05 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:294b0fd4-9daa-4d06-89c0-f2eaebfe68f6</guid><dc:creator>Former Member</dc:creator><description>Great, thanks Chris, that worked.

Yes I&amp;#39;m a subscriber, so will be updating!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Selected Drop Down value with onChange</title><link>https://www.aras.com/community/thread/2188?ContentTypeID=1</link><pubDate>Mon, 22 Oct 2018 15:28:53 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:2d5fd0af-d68b-44b8-a9bd-69ff4149c1c9</guid><dc:creator>Christopher Gillis</dc:creator><description>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&amp;#39;d recommend setting a timeout with a very small duration and looking up the value in there like the example below.

&lt;pre&gt;&lt;code&gt;setTimeout(function() {
var value = getFieldByName(&amp;quot;z_prefix&amp;quot;).getElementsByTagName(&amp;quot;input&amp;quot;)[0].value;
}, 10); // &amp;lt;-- 10ms worked in my test environment, but you may find you need to increase the duration of this timeout&lt;/code&gt;&lt;/pre&gt;


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 &lt;code&gt;this.value&lt;/code&gt; without the timeout in order to retrieve the new value in an onChange event.

Chris

&lt;hr /&gt;

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>