Unfortunately it's not currently possible to make certain fields mandatory. However, this feature has been requested previously - MDL-5583. Please vote for the issue if you'd like it to be fixed (you'll need a tracker account) to help developers determine development priorities.
Hi All
Can anyone tell me if this works yet in Moodle 2.0? I can't find a way to specify mandatory fields. If there's no easy tick box, does anyone know whether adding some Javascript in the Javascript template will do the trick, and if so, what i should be adding?
thanks!
Emma
You should be able to do this easily in dataform developed by Itamar Tzadok. Please note that it is still a beta version.
Yes, with most of the fields in the dataform you can add to the view template a tag [[*fieldname] ] to make the field required when adding/editing an entry. The plan is to get the dataform over beta by the end of august (unit tests are already working but we need more).
You can also use javascript but this is not foolproof as the user can turn the javascript off. If you use javascript you can set the template to hide or disable the input fields by css and let the javascript enable them. This way turning off the javascript would prevent entering the form. That would still not be foolproof but it may be enough for your purpose.
Hi!
Is there someone that can explain me how to set up the mandatory fields?
I don't understand very well neither the procedure with the *fieldname neither the one in MDL-21969.
Thanks!
The mandatory fields in the Database activity will be available from 2.9. You will set the field as required in the field configuration.
The mandatory fields by * in the field pattern is not in the Database activity but in the Dataform activity. So, if you are using the Database, this option is not available for you.
Thanks! We will wait for the next upgrade!
Thank you, Itamar. I just tried a Database activity in a test version of Moodle 2.9dev and it works. Great!
With kind regards,
Hartmut
I'm using Moodle 3.0.2 (Build: 20160111) but I see no place where I could set certain fields manatory. Is this option implemented yet?
With best regards,
Nils
There is a checkbox 'Required field' in the configuration form of the fields. Not sure why you can't see it. Can you post a screenshot?