# Required on Repeater Field

**URL:** <https://discourse.getcockpit.com/t/required-on-repeater-field/504>\
**Category:** Support\
**Created:** [January 9, 2019, 10:04am UTC](https://discourse.getcockpit.com/t/required-on-repeater-field/504 "2019-01-09T10:04:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![parallactic](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/parallactic/32/208_2.png) [@parallactic](https://discourse.getcockpit.com/u/parallactic)\
**Post date:** [January 9, 2019, 10:04am UTC](https://discourse.getcockpit.com/t/required-on-repeater-field/504/1 "2019-01-09T10:04:47Z")

</div>

Hi

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

```javascript
{
  "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

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [January 9, 2019, 11:35am UTC](https://discourse.getcockpit.com/t/required-on-repeater-field/504/2 "2019-01-09T11:35:00Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![parallactic](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/parallactic/32/208_2.png) [@parallactic](https://discourse.getcockpit.com/u/parallactic)\
**Post date:** [January 10, 2019, 8:30am UTC](https://discourse.getcockpit.com/t/required-on-repeater-field/504/3 "2019-01-10T08:30:10Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [October 7, 2019, 9:10am UTC](https://discourse.getcockpit.com/t/required-on-repeater-field/504/4 "2019-10-07T09:10:44Z")

</div>

Don’t think so, that’s a definition available only on the main collection fields.

---

<div class="post-metadata">

**Author:** ![moabi](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/moabi/32/417_2.png) [@moabi](https://discourse.getcockpit.com/u/moabi)\
**Post date:** [October 7, 2019, 9:27am UTC](https://discourse.getcockpit.com/t/required-on-repeater-field/504/5 "2019-10-07T09:27:28Z")

</div>

Ok that would be a reply to [Localize a sub field in a repeater (options)](https://discourse.getcockpit.com/t/localize-a-sub-field-in-a-repeater-options/1048)
