Problems with "Fields marked with an asterisk (*) are required"

Hi, I have an experiment in JS (I’m not using it in pavlovia or psychopy) and I’m trying to have some fields obligatories by using * like in the image, but it doesn’t work.
Could somebody help me?
Best regards.

Please can you tell us more about what doesn’t work? is it that the experiment progresses even when those fields are not complete?


It’s supposed that when I include the asterisk and when the fields are not filled the ok button shouldn’t work, but the button works.