passing data from form to "use server"
Answered
American Shorthair posted this in #help-forum
American ShorthairOP
How can i pass custom data from form to the server action
10 Replies
American ShorthairOP
i want to pass that guild.id
so i can add it to the cookies in the server action
ping when reply please
@American Shorthair with the code you show, you can add:
in your form
<input name='guildId' value={guild.id} type='hidden' />
in your form
you should see it in your console.log
there is also a quicker way
<button name='guildId' value={guild.id} type='submit' />
😄
Answer
American ShorthairOP
Thanks alot
100% legit too when you want to attach a value to an action button
American ShorthairOP
So anyone can just use this to use my server action?