Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wrapper around nested controls with FormGenerator #78

Open
arthurhamon opened this issue Jan 24, 2022 · 0 comments
Open

Add wrapper around nested controls with FormGenerator #78

arthurhamon opened this issue Jan 24, 2022 · 0 comments

Comments

@arthurhamon
Copy link

Hello,

I have this dynamically build fieldConfig and I have nested controls inside, see phoneNumberRow prop.
How can I render the form with a div around the two controls phoneNumberPrefix and phoneNumber ?

const fieldConfig = {
  "civility": {
    "meta": {
      "label": "Title",
      "name": "civility",
      "type": "hidden"
    }
  },
  "firstName": {
    "meta": {
      "label": "First name",
      "name": "firstName",
      "type": "text"
    }
  },
  "lastName": {
    "meta": {
      "label": "Surname",
      "name": "lastName",
      "type": "text"
    }
  },
  "phoneNumberRow": {
    "controls": {
      "phoneNumberPrefix": {
        "meta": {
          "label": "Phone code",
          "name": "phoneNumberPrefixChoiceList",
          "optionList": [
            {
              "value": "ad_376",
              "textLabel": "+376",
              "listTextLabel": "+376 (Andorra)"
            },
            {
              "value": "au_61",
              "textLabel": "+61",
              "listTextLabel": "+61 (Australia)"
            },
            {
              "value": "at_43",
              "textLabel": "+43",
              "listTextLabel": "+43 (Austria)"
            }
          ]
        }
        "formState": "au_61"
      },
      "phoneNumber": {
        "meta": {
          "label": "Mobile number",
          "name": "phoneNumber",
          "type": "number"
        }
      }
    }
  },
  "company": {
    "meta": {
      "label": "Company (optional)",
      "name": "company",
      "type": "text"
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant