Next.js Discord

Discord Forum

useActionState

Unanswered
Gray-breasted Martin posted this in #help-forum
Open in Discord
Gray-breasted MartinOP
Hey.

How do I implement advanced validation in client side when using useActionState?

I don't want to submit a form if I know the fields are invalid, there is no reason to do so in my opinion.

I feel like when using useActionState you shouldn't use use state, but it looks like I might have to do so when one field depends on another field value.

For example

Two fields of date picker, one year
Second is month

And the month depends on year.

How can you achieve such functionality?

0 Replies