What value is stored in the Select field?
Select (also known as a dropdown list) consists of values
(also known as options) and displays
(what is shown to the user).
The field stores values
. By default, these are the id
of the rows from the table that the Select references.
Displays are calculated each time the page is opened according to the formula specified in the select code.
What value do we see in the Select field?
The user sees display
.
Select code calculates the correspondence of values
and displays
:
1
= apple
2
= banana
3
= melon
The user sees apple, banana, melon
. If they choose banana
, its base — 4
— will be saved in the field, while the user will see the display banana
calculated by select code.
But the field stores the value
, i.e., 4
. And if we retrieve it with code:
= : #select
We will get exactly 4
.
If the line the select looks at is changed, at what moment do we see the change in the field?
At the first table update.
What will be changed: the value or the display?
The display
will change. The value
remains unchanged and links the field to a row in another table.
Why do I need the "Display for empty value" parameter when the value is empty?
To be able to select an empty value.