Creating a generic form
What is the best way to achieve the following : I 'm creating a generic form component that takes in a JSON schema and builds the form from that . I 've successfully managed to build the form using repeated <input > elements , but I am struggling with collecting the form data on submission . I have a form -values variable , which is submitted with my component 's submit trigger (triggered by the submit button 's click trigger ) , but the issue is getting the values from each input field and storing them nicely as JSON in the form -values variable . Initially I was just appending the data sent by each input field 's change event , but that gets messy if the user enters each field more than once . A workaround would be to store form -values as a dictionary , and search through the dictionary when getting the value from the change event . But that seems messy . I 'm very new to NordCraft so I 'm wondering if there is something obvious I have missed . I can 't see any way to cleanly expose a child component 's variable to its parent , so I 'm a bit stuck . Any suggestions ? Thanks in advance ! ✅1For example if your form JSON looks something like this : [
{"label": "First name",
"placeholder": "Ethan",
"type": "text",
"value": null
},
{"label": "Last name",
"placeholder": "Nordcraft",
"type": "text",
"value": null
}
]Then you can use the Set node to set your form -values variable (I definitely haven 't spent 2 hours on this ) Something like that