laravel-form-builder
laravel-form-builder copied to clipboard
Readonly select
Hi there. It would be great if supporting of readonly select will be. Because if I will use 'disabled' attribute, then value will not be received on server. In some question on stackoverflow I found this solution:
You should keep the select element disabled but also add another hidden input with the same name and value.
You should be able to simulate this on your own, by creating a hidden input and assigning a value from it.
Here solution to achive readonly. you do not need to use select veriable.
->add('amount', Field::TEXT, [ 'attr' => ['readonly class' => 'form-control-plaintext'], 'rules' => 'required|max:25', 'value' => $this->getModel()->amount ])