psychopy.org | Reference | Downloads | Github

Make dialog box fields compulsory

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. But it shows an error in the while loop.

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

Please see this for reference:

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

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

Hi @dvbridges,

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