Add new parent in select field

Hi, I have a one to many relationship, in the child create form I have a select field. Is it possible to create a new parent if it does not exist without changing view? Or would I need to create a custom field?
6 Replies
Dennis Koch
Dennis Koch2y ago
I think it's ->createOptionForm()
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MikePageDev
MikePageDevOP2y ago
Thanks I will have a look Thanks I didn't see this in the docs (didn't scroll down enough). Second question. How do I add a value to a hidden field? I need to add the currently logged in users id to be entered into the dB.
Cybrarist
Cybrarist2y ago
you can use ->default but i think it' better to handle it in the backend, otherwise anyone can inspect the html and change the vlaue
Dennis Koch
Dennis Koch2y ago
Don't use a hidden field. They are insecure. Use a lifecycle callback
MikePageDev
MikePageDevOP2y ago
Ah ok. Thank you I have it working really nicely now.
Want results from more Discord servers?
Add your server