Dynamically create password fields in Oracle APEX 19.2

284 Views Asked by At

How is it possible to dynamically create password type input fields in Oracle APEX 19.2? Read about using APEX_ITEM package, but there is no function for password fields there.

1

There are 1 best solutions below

0
On

I just had this problem as well and I had to come up with my own solution, here it is:

First, create your APEX_ITEM with a special class name (I have used 'pwd') In the following example I'll imagine we are creating the Item inside a report:

SELECT APEX_ITEM.TEXT( 1, field_value, NULL, NULL, 'class="pwd"' ) AS pwd_column_name FROM DUAL

After the field has been created run javascript to find the inputs with class 'pwd' and change their type to 'password'. (e.g. on the report add a Dynamic Action -> After Refresh -> Execute Javascript code)

$('.pwd').attr('type', 'password');