Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get value of Switch control via Javascript

AnnelizeFAug 24 2021 — edited Aug 24 2021

Hi
We've upgraded to APEX 21.1.2 (cloud) recently and changed all our radio buttons / 3rd party switches to the APEX Switch.
After the upgrade I've noticed that dynamic actions that gets the client-side value of a switch via javascript, does get the correct value. We need to be using Javascript as there is more than one page item to check in the dynamic action.
I've created an example app and demonstrating the problem (link below). When you choose "Yes" in either of the switches, a text box should appear. In the "Under 18?", which uses a Client-Side condition of Item=Value , it works as expected
"Interpretor Required?" however uses the following javascript, and nothing happens:
$x('P2_INTERPRETOR_REQUIRED').value == 1;
Any idea if this is a known bug? Or has the syntax changed for the switch in the new release?
-- Demo --
Page 2 : Switch
Workspace: af_plays
Login: demo / _af_plays

Thanks,
Annelize

This post has been answered by InoL on Aug 24 2021
Jump to Answer
Comments
Post Details
Added on Aug 24 2021
7 comments
1,405 views