# Make dialog box fields compulsory

**URL:** <https://discourse.psychopy.org/t/make-dialog-box-fields-compulsory/15603>\
**Category:** Online experiments\
**Tags:** dialog\
**Created:** [August 10, 2020, 12:16pm UTC](https://discourse.psychopy.org/t/make-dialog-box-fields-compulsory/15603 "2020-08-10T12:16:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Surabhi\_Lodha](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/surabhi_lodha/32/5053_2.png) [@Surabhi\_Lodha](https://discourse.psychopy.org/u/Surabhi_Lodha)\
**Post date:** [August 10, 2020, 12:16pm UTC](https://discourse.psychopy.org/t/make-dialog-box-fields-compulsory/15603/1 "2020-08-10T12:16:07Z")

</div>

Hello,

I want to ensure that the participants are not allowed to move forward with the experiment until they have filled certain fields in the dialog box (compulsory filling).

I got a code for the same from another related link [Dialog box empty text prevent](https://discourse.psychopy.org/t/dialog-box-empty-text-prevent/1149). But it shows an error in the **while loop**.

```auto
infoDict = {'Name:': '', 'Attempt:': ''}
while not infoDict['Name:']:
    dlg = DlgFromDict(dictionary=infoDict)

```

Please see this for reference:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/d/4/d4fc2f1785d40701fb7fcb23002945e24dd600dd.png)

What could be the issue here?  
P.S. I do not intend to use \*asterisk to make it compulsory.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [August 11, 2020, 3:52pm UTC](https://discourse.psychopy.org/t/make-dialog-box-fields-compulsory/15603/2 "2020-08-11T15:52:53Z")

</div>

Hi @Surabhi_Lodha, I am interested why the asterisk is not useful here?

---

<div class="post-metadata">

**Author:** ![Surabhi\_Lodha](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/surabhi_lodha/32/5053_2.png) [@Surabhi\_Lodha](https://discourse.psychopy.org/u/Surabhi_Lodha)\
**Post date:** [August 11, 2020, 3:58pm UTC](https://discourse.psychopy.org/t/make-dialog-box-fields-compulsory/15603/3 "2020-08-11T15:58:32Z")

</div>

Hi @dvbridges,

Sorry, but I got confused with the function of an asterisk. It definitely works. Thank you 🙂
