Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Show/Hide a text field depending on Select List choice in Oracle Apex?

Simple question but I'm new to Apex...

Basically I have two items: a Select List and a Text Field. By default the text field should not appear. The Select List has two values for the user to choose from. If the user selects on of the values then the text field will stay hidden but if the user selects the other value then the text field will appear.

Example:

From the Select List the user can choose either "Show" or "Hide". If the user chooses "Hide" the text field should be hidden, as it should be by default. But if the user chooses "Show" then the text field will appear.

How can I do this?

TIA

like image 361
Stephen Walsh Avatar asked Mar 11 '13 14:03

Stephen Walsh


1 Answers

Try this:

  1. Bring up the select list item. Go to the List of Values section and ensure the following is set:

    • Display null value: No
    • List of Values Definition: STATIC:SHOW;SHOW,HIDE;HIDE [you can replace this with stored LOV if you wish]

  2. Create a new dynamic action with the following properties:

    Main Properties

    • Event: Change
    • Selection Type: Item(s)
    • Item: [P1_SELECT_LIST]
    • Condition: Equal to
    • Value: SHOW

      True Action

    • Action: Show

    • Fire when Result is: True
    • Fire on page load: Yes
    • Selection Type: Item(s)
    • Item: [P1_TEXT]

      False Action

    • Action: Hide

    • Fire when Result is: False
    • Fire on page load: Yes
    • Selection Type: Item(s)
    • Item: [P1_TEXT]
like image 104
Ro Milton Avatar answered Oct 01 '22 18:10

Ro Milton