Required on Repeater Field


#1

Hi

Is it possible to set a field in a repeater field to “required: true”? I tried this:

{
  "field": {
    "type": "set",
    "name": "level",
    "label": "Level",
    "options": {
      "fields": [
        {
          "type": "text",
          "name": "title",
          "label": "Titel",
          "required": true
        },
        {
          "type": "repeater",
          "name": "options",
          "label": "Optionen",
          "required": true,
          "options": {
            "field": {
              "type": "set",
              "name": "option",
              "label": "Optionen",
              "options": {
                "fields": [
                  {
                    "type": "text",
                    "name": "title",
                    "label": "Titel",
                    "required": true
                  },
                  {
                    "type": "file",
                    "name": "sound",
                    "label": "Sound"
                  }
                ]
              }
            }
          }
        }
      ]
    }
  }
}

but it ignores the required in the form.
Thank you for any help!

Patrick


#2

can you try to set the required attribute inside an “options” attribute, e.g.:

"fields": [
  {
    "type": "text",
    "name": "title",
    "label": "Titel",
    "options": {
      "required": true
    }
  }
]

#3

aah! you’re right, option did the trick.
do you know if it is also possible to set the option “localize” to some of the fields within a repeater?