Replies: 2 comments 1 reply
-
Same problem here and I didn't find the solution... |
Beta Was this translation helpful? Give feedback.
0 replies
-
The |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using shadcn Form and Date Range Picker, I tried to use server action and I recieved no date or any data.
This is my server action and data that prints out is empty.
This is my date range picker, I am using it inside Form component both from shadcn
In client side, the date is shown from console.log when submitted,
The problem is that there is no "name" attribute that server action requires and I'm not sure where to put the "name" attribute, I have tried to put the "name" attribute on every html tag, I tried swapping the Button (inside FormControl) for a Input but that causes the placeholder to show "Object, Object" but it did show on server action console.log but the value was was empty strings.
I know that I can call the server action inside the onSubmit call and add my parameters there but I would like to avoid that as I would like to use "useFormState" and "UseFormStatus" Hook.
I will do more research and I'll try to use "hidden input"
"Good to know:
An alternative is to pass arguments as hidden input fields in the form (e.g. ). However, the value will be part of the rendered HTML and will not be encoded.
.bind works in both Server and Client Components. It also supports progressive enhancement." - From Next.js docs
Beta Was this translation helpful? Give feedback.
All reactions