I'm currently working on developing forms for our website using AngularJS. On the page, there will be two checkboxes labeled "Form 1" and "Form 2", with Form 1 being checked by default. When both Form 1 and Form 2 are checked, only distinct fields between them should be displayed.
Below is a snippet of my JSON data:
[
{
"form_id": 1,
"form_name": "Form 1",
"form_field_list": [
{
"form_field_id": 1,
"form_field_label": "First Name",
"form_field_value": ""
},
{
"form_field_id": 2,
"form_field_label": "Last Name",
"form_field_value": ""
},
{
"form_field_id": 3,
"form_field_label": "Email",
"form_field_value": ""
}
]
},
{
"form_id": 2,
"form_name": "Form 2",
"form_field_list": [
{
"form_field_id": 1,
"form_field_label": "First Name",
"form_field_value": ""
},
{
"form_field_id": 2,
"form_field_label": "Last Name",
"form_field_value": ""
},
{
"form_field_id": 4,
"form_field_label": "Comments",
"form_field_value": ""
}
]
}
]
For example, selecting "Form 1" checkbox should display the following input fields: First Name Last Name Email
If "Form 2" checkbox is selected, the following input fields should be displayed: First Name Comments
When both checkboxes are checked, these input fields should be displayed: First Name Last Name Email Comments
I'm uncertain about how to proceed. Should I create a separate JSON list first containing only unique form_field_list objects?