How can I prevent a TextInput from the form from being registered or sent to the new record?
How can I prevent a TextInput from the form from being registered or sent to the new record?
14 Replies
TextInput ->disabled()?
->dehydrated(false)
Hopefully you are not using this for holding some record id 😉
not for the id record but for autogenerators such as the slug or a code string F0001
it is right?
If it’s not required to show in the form, maybe don’t generate and hide it then
Use the mutate function instead
Fair warning anything using a
Hidden
field can be mutated by the user on the front end. That's the point wyChoong is making. It should really never be used unless absolutely necessary.mutateFormDataBeforeCreate
In my case, to make a new record when entering the item in the warehouse. I require the product id and the warehouse id, but since it is in a
ProductsRelationManager
with the ownerRecord I get the warehouse id.
How can I pass the warehouse ID to the record without showing it in the form?
@awcodes @wyChoong 🤔
Access ownerRecord here
OK, any clear example of where to use it or in what class? thx
In your relationship manager table header action
done. 👍