Replies: 1 comment
-
I have a couple ideas. First IdeaIf you're aiming for a no JS based solution: Split your forms up wherever the conditional boundaries lie. In your form action handler, capture each submission and return some data indicating if the next part of the form should be shown given the selections made. In the component, use the action hook to retrieve that same data and conditionally render the next form as appropriate. My other ideaIf you want to do it via JS on the client, store responses to the questions in a useState value and conditionally render other forms based on the state variables. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the new or updated feature that you are suggesting?
Is there a recommended way to handle dynamic nested fields in forms, similar to what the (fields_for helper)[https://apidock.com/rails/v6.1.3.1/ActionView/Helpers/FormHelper/fields_for] does in Rails or (express.bodyParser middleware)[http://expressjs.com/en/resources/middleware/body-parser.html] in express?
Why should this feature be included?
There is no clear way, without writing a custom parser, to implement a nested form working without javascript, which as far as I understand, is a pivotal principle in the
implementation in remix.Beta Was this translation helpful? Give feedback.
All reactions