APEX Version: 21.1.5
I am trying to make a dynamic action that has somewhat more complicated triggering condition that available to the Client-side Condition Types, other than a JavaScript expression. The condition in PL/SQL basically looks like:
((:PX_A IS NOT NULL AND :PX_A_YEAR IS NULL) OR (:PX_B IS NOT NULL AND :PX_B_YEAR IS NULL))
Background: the purpose of my DA is to let the user know, through an alert, that their input is inconsistent. Also, I tried putting the condition as a Server-side Condition, but that doesn't seem to be working. I'm guessing it's because it's “Server-side” i.e. it's looking at the data in the database, not the data that is actively being input by the user.
So I've been trying a JavaScript expression. However, I'm having difficulties, and I believe it is because the Page Items are Number fields, rather than text fields. Additionally, :PX_A and :PX_B are masked as well, with this mask: “FML999G999G999G999G990” (currency).
I've tried numerous variations to get the values of these fields (I've started trying to just print the values to the console):
$("#PX_A")
$("#PX_A").val()
$v("PX_A") / $v('PX_A')
document.getElementById('PX_A').value
- And the others described here
I looked up variations of “oracle apex how to get value of number field” in Google, and no luck…
The closest I've gotten is: $("#PX_A")
which returns [object Object]
. I also feel that I got the object to be represented where I could inspect it, but at this point I can't remember what version of getting the value got me that result… and even when I did a) the object was massive so it was hard to look through everything and b) any “val” or “value” attributes / properties showed a length of 1 even as I was looking at the Page Item on the screen and it clearly was longer than a length of 1.
I referenced this article to check for the NULL and NOT NULL, but what is proposed there ($("#P3_ITEM1").val().length)
) doesn't return anything when I try to simply print the value with console.log($("#PX_A").val());
.
I'm wondering if anyone knows how to access the value of a Number field (whether masked or not). Hopefully I haven't missed something glaringly obvious. Much appreciated.