Form. How to add readonly attribute to text field? #5463
-
Hi there, i know that is possible to disable a field with ->disabled(). But disabled fields aren't in POST so it doesn't saved. I need readonly field because i want to save value, but user cannot edit directly. I also know that i can make textinput disabled() and next add a Hidden field, in this way i have i text field not editabled and i can save field with hidden..... But i think it not elegant solutions and lot of code for nothing... Best solution is a add method ->readonly() like ->disabled() Or have you any suggestion? Regards |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure we have |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Perhaps helpful to include in the upgrade guides that disabled() no longer passes data and that readonly() should be used. |
Beta Was this translation helpful? Give feedback.
->extraInputAttributes(['readonly' => true])