# Required filelds in Set

**URL:** <https://discourse.getcockpit.com/t/required-filelds-in-set/1420>\
**Category:** General\
**Created:** [May 3, 2020, 5:58pm UTC](https://discourse.getcockpit.com/t/required-filelds-in-set/1420 "2020-05-03T17:58:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![terencejackson8000](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/terencejackson8000/32/641_2.png) [@terencejackson8000](https://discourse.getcockpit.com/u/terencejackson8000)\
**Post date:** [May 3, 2020, 5:58pm UTC](https://discourse.getcockpit.com/t/required-filelds-in-set/1420/1 "2020-05-03T17:58:20Z")

</div>

Hi,

I have defined a set with three items: 2 texts and 1 wysiwyg. The wysiwyg is supposed to be a mandatory field, the 2 texts are not mandatory.  
I have tried the following:

```auto
{
      "type": "set",
      "name": "textOnly",
      "label": "Text only",
      "options": {
        "fields": [
          {
            "type": "text",
            "name": "sectionTitle",
            "label": "Section title"
          },
		  {
            "type": "text",
            "name": "sectionSubtitle",
            "label": "Section subtitle"
          },
		  {
            "type": "wysiwyg",
            "name": "text",
            "label": "Text",
            "required": true
          }
        ]
      }  
    }
	

```

Unfortunately it is not working. I also cannot find anything in the docs.  
Does anyone of you have any idea how I can get it done that I get a mandatory (required) field in a set?

---

<div class="post-metadata">

**Author:** ![alessandro1992ma](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@alessandro1992ma](https://discourse.getcockpit.com/u/alessandro1992ma)\
**Post date:** [May 5, 2020, 12:22pm UTC](https://discourse.getcockpit.com/t/required-filelds-in-set/1420/2 "2020-05-05T12:22:22Z")

</div>

```
{
  "type": "set",
  "name": "textOnly",
  "label": "Text only",
  "options": {
"fields": [
  {
    "type": "text",
    "name": "sectionTitle",
    "label": "Section title"
  },
  {
    "type": "text",
    "name": "sectionSubtitle",
    "label": "Section subtitle",
    "options": {
      "required": true
    }
  },
  {
    "type": "wysiwyg",
    "name": "text",
    "label": "Text",
    "options": {
      "required": true
    }
  }
]
  }  
}

```

so it works for me, I had your same problem.

But for the wysiwyg field I don’t know if it works properly

---

<div class="post-metadata">

**Author:** ![terencejackson8000](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/terencejackson8000/32/641_2.png) [@terencejackson8000](https://discourse.getcockpit.com/u/terencejackson8000)\
**Post date:** [May 5, 2020, 8:07pm UTC](https://discourse.getcockpit.com/t/required-filelds-in-set/1420/3 "2020-05-05T20:07:05Z")

</div>

Hi Alessandro,

it indeed works for a normal text like this: Thank you for helping me out here.  
It also works for select.

Unfortunately it does not work with wysiwyg (I also tried with Image where it did not work ☹ )

---

<div class="post-metadata">

**Author:** ![alessandro1992ma](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@alessandro1992ma](https://discourse.getcockpit.com/u/alessandro1992ma)\
**Post date:** [May 7, 2020, 11:33am UTC](https://discourse.getcockpit.com/t/required-filelds-in-set/1420/4 "2020-05-07T11:33:49Z")

</div>

Hi,  
I am very pleased to have helped you, for the images it should work correctly (from what I remember).

For the text wysiwyg yes as I wrote to you I also noticed that it does not work, but perhaps you can find something in the TinyMCE options.

> **[TinyMCE | Documentation](https://www.tiny.cloud/docs/)**
>
> Official documentation for the most advanced and widely deployed rich text editor platform.
