In my forms I need a field to only display data. No editing will be done on this data so I feel it’s not enough to set read_only on a text field. The idea is to create custom form field type that would accept different formats as the value (ex. DateTime, String).
The output would be somethink like
<div>
<label>My Label</label>
My value
</div>
I’ve been looking into the docs and also the code of the predefined field types but couldn’t make out how to go on 🙁
I’m not looking for the complete code, only need directions…
Thanks
Finally, thanks to another thread on Stackoverflow, I went with DataTransformer (see the Docs).
This way I add the field as a text type and add a custom DataTransformer to the FormBuilder which will convert the data to the type I need.
If anyone is interested in it I will post the code.