How to add custom values to Editor Field Options
How to add custom values to Editor Field Options

Hello, I have an Editor Field
label: "Employee ID:",
name: "employee_id",
type: "select" ,
},
that pulls its values from
Field::inst( 'db.employee_id' )
->options( Options::inst()
->table( 'Employees' )
->value( 'empl_id' )
->label( 'empl_descr' )
)
->validator( Validate::dbValues() ) ,
This returns a dropdown list with 5 rows.
I want with custom render to add 1 more row to this Field Options-dropdown list (e.g. "0" or "null","Front Desk").
I don't want to add this row to the db table.
Thank you in advance!
This discussion has been closed.
Answers
Anyone here to help please?
Allan, Colin, kthorngren ??
If its just a default option you want to add then the
placeholder
option of theselect
field type is the way to do this. If you want to make it selectable thenplaceholderDisabled
can be set tofalse
andplaceholderValue
can be used to define its value.Allan