Set field default values before displaying a form builderCreated 5 years ago by edster
Trying to set a few fields default values dynamically. However I can't figure out where in the build process or how to set them.
$builder->getForm()->setValue(key, value) but it doesn't work.
edster — 5 years ago
@ryanthompson are you refering to on the fields?
Doing something like this doesn't work
$fields = $checkoutBuilder->getFields(); $fields['lot'] = [ 'default_value' => $this->unit['lot'], 'readOnly' => TRUE ];
but doing the below does?
$fields = $checkoutBuilder->getFields(); $fields['lot'] = [ 'value' => $this->unit['lot'], 'readOnly' => TRUE ];
ryanthompson — 5 years ago
config value: https://pyrocms.com/documentation/text-field-type/2.2/introduction/configuration
But it is supported across the board by core functionality - so it doesn't technically "live" in the FTs.