# Viewer doesn't set REQUIRED flag for required fields

**URL:** <https://pdfjs.community/t/viewer-doesnt-set-required-flag-for-required-fields/358>\
**Category:** Bug Reports\
**Created:** [October 25, 2020, 5:52pm UTC](https://pdfjs.community/t/viewer-doesnt-set-required-flag-for-required-fields/358 "2020-10-25T17:52:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![barr.develop](https://avatars.discourse-cdn.com/v4/letter/b/f0a364/32.png) [@barr.develop](https://pdfjs.community/u/barr.develop)\
**Post date:** [October 25, 2020, 5:52pm UTC](https://pdfjs.community/t/viewer-doesnt-set-required-flag-for-required-fields/358/1 "2020-10-25T17:52:42Z")

</div>

**PDF.js Express Version**  
7.1.2

**Detailed description of issue**  
PDF.js express doesn’t recognize required fields.  
When I create PDF document using Adobe Acrobat and add required fields - these fields do not have required flag: `field.flags.get(Annotations.WidgetFlags.REQUIRED);`.  
Btw, read-only flag works fine.

**Expected behaviour**  
Expect to see `Required` flag is set for required fields.

**Link to document**  
[PDFForm.pdf](https://pdfjs.community/uploads/short-url/7JeTmUUGWpdwQMpQ0SWJKomNJN5.pdf) (56.8 KB)  
file contains required field as an example.

**Code snippet**

```javascript
      const fieldManager = annotManager.getFieldManager();
      fieldManager.forEachField(field => {
        const isRequired = field.flags.get(Annotations.WidgetFlags.REQUIRED);
      });

```

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [October 26, 2020, 3:10pm UTC](https://pdfjs.community/t/viewer-doesnt-set-required-flag-for-required-fields/358/2 "2020-10-26T15:10:42Z")

</div>

Hey there!

Thanks for the bug report and the document. We can reproduce the issue and will have it fixed in a future release.

Edit: We have found and fixed the problem, so hang tight for the next release!

Thanks,  
Logan
