Required "Select" forms component saving empty data.
- Create a select form component and make it required
- Open the page and fill the rest of the form but keep the select empty (placeholder)
- Save the form = it will give error to choose from the select
- Now select any option and save again
= the chosen option will not be saved
- try to open the page again to update = you will see that the select has nothing chosen.
Note: if I will open the form and and choose select option before trying to save in the first place = data will be saved without any issues.
is this a bug, or am I doing something wrong
2 Replies
I see you have both
->relationship()
and ->options()
, not sure if that could be the issue.I actually was commenting one and trying the other
but still
that's why I added the default so to prevent this issue incase the user forgot to choose.