Hi guys!
I’m come up to you today because I would like to generate multiple forms from a fixed json structure inside a single column.
This because now you can’t generate different forms (unless you use multiple tables)!
I tried the new component and I wrote this prompt with Claude:
Create an HTML form that takes its questions from inputJSON fusing Alpine.js. The form should be styled with CSS. The JSON include categories, descriptions, and questions with a choice from 1 to 5. The responses should be saved through a click action.
The problem is that I would like to customise the html (the style for example) and the other elements, but i don’t know how to insert the variables from json.
But unfortunately I can’t figure out how to do this! I have also tried via the console, but everything comes back already generated!
I leave below also a simple json structure that can be modified for every column:
[
{
"category": "Customer Satisfaction",
"description": "Evaluate your level of satisfaction with the following aspects of our service.",
"questions": [
{
"question": "Staff Courtesy",
"id": "q1"
},
{
"question": "Wait Time",
"id": "q2"
},
{
"question": "Product Quality",
"id": "q3"
}
]
},
{
"category": "User Experience",
"description": "Evaluate your overall experience with our website.",
"questions": [
{
"question": "Ease of Navigation",
"id": "q4"
},
{
"question": "Loading Speed",
"id": "q5"
},
{
"question": "Design and Layout",
"id": "q6"
}
]
}
]
Image of the form:
I think this may help many others!
Thanks