User profile fields: Conditional field

Maintained by Picture of Shamim Rezaie Shamim Rezaie
A drop-down menu field that shows/hides some other custom profile fields depending on its selected value.
361 sites
21 fans

The conditional profile field plugin is an advanced version of the dropdown menu profile field type in which you can decide to hide/show some other profile fields based on the value selected for this field.

This allows you designing dynamic signup/profile pages.

You can also set some other fields to be required based on the selected value for this field.

If this plugin makes your life easier, you can treat me a coffee smile

Buy Me a Coffee at


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5


Picture of Shamim Rezaie
Shamim Rezaie (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Shamim Rezaie
    Thu, 16 Mar 2017, 1:09 PM
    Thank you, Ricardo, for your comment and sorry for the inconvenience it might have caused.
    I have fixed this in the new version. Please update the plugin.
  • Picture of Ricardo Méndez
    Fri, 17 Mar 2017, 10:43 PM
  • Picture of sara rabie
    Tue, 28 Mar 2017, 6:12 PM
    Thank you for great plugin but i have and issue when try to signup it release error in insert to database say dataformat cannot be null when field insert to table mdl_user_info_data although this field is hidden from the plugin but it cannot save but when try add user from add new user form it save well . i removed plugin and used css and jquery to hide fields on condition and it worked please solve issue for signup form
  • Picture of Shamim Rezaie
    Tue, 28 Mar 2017, 8:34 PM
    Please file an issue at and provide as much details as possible so I can replicate your issue.
    Please mention your Moodle version and also mention type of the fields you are trying to depend to each other.
  • Picture of sara rabie
    Wed, 29 Mar 2017, 4:03 PM
    ok thank you but please tell me if you solved it to use it because it will save alot of time if i use it
  • Picture of László Pauer
    Mon, 8 May 2017, 10:29 PM

    For some reason, the window where I could set the conditions, does not look like the one in the documentation:

    Could you please tell me what is the problem here?

  • Picture of Shamim Rezaie
    Tue, 9 May 2017, 1:11 PM
    Hi László Pauer,
    You have not created any other profile fields before trying to create the conditional field. You need to have some profile fields so then you'd be able to hide some of them.
  • Picture of László Pauer
    Tue, 9 May 2017, 2:29 PM
    Thanks for the answer, but I previously made a bunch of other custom profile fields (~50), so that can't be the problem.
  • Picture of László Pauer
    Thu, 11 May 2017, 9:19 PM
    For example, these are all custom profile fields, all displayed on the registration page:

  • Picture of Shamim Rezaie
    Mon, 15 May 2017, 8:58 AM
    Hi László Pauer,
    Please file an issue at and provide as much details as possible so I can replicate your issue.
    Please mention your Moodle version as well.
  • Picture of Nicolás Gómez
    Sat, 29 Jul 2017, 7:42 AM
    Hello, I guess it's a very good plugin, although I have a trouble. When I select the "Conditional Field" it redirects me to: "/user/profile/index.php?id=0&action=editfield&datatype=conditional"; and shows this error mesage:

    Esta página no funciona

    La página no puede procesar esta solicitud ahora.
    HTTP ERROR 500

    I tried with a checkbox and the redirection is almost the same: /user/profile/index.php?id=0&action=editfield&datatype=checkbox".

    Moodle Version 3.1
    Language: Spanish

    Thanks in advance.
  • Picture of Shamim Rezaie
    Sun, 30 Jul 2017, 3:53 AM
    Hi Nicolás,
    Please turn on debugging mode in 'Site Administration > Development > Debugging'.
    Set 'Debug messages' to 'DEVELOPER: extra Moodle debug messages for developers' and select the 'Display debug messages' checkbox. Then please try again to add a conditional field. You would see an error message with some useful information about the error.
    Please file an issue at and post debugging information there.
  • Picture of Nicolás Gómez
    Sat, 9 Sep 2017, 5:03 AM
    Hi Shamim,

    Thank you for your answer.

    I made it and the error message says: Fatal error: Can't use function return value in write context in /path/to/my/installation/user/profile/field/conditional/define.class.php on line 126.

    Thanks again.
  • Picture of Shamim Rezaie
    Sat, 9 Sep 2017, 8:14 PM
    Hi Nicolás,
    Please report this at
    Also please confirm if you can add other profile field types (like checkbox) without any problem.
  • Picture of Tanja Messerschmidt
    Tue, 26 Jun 2018, 4:09 AM
    Hi Shamim,
    I am looking forward to seeing your plugin available for moodle 3.5.
    Thanks in advance.
1 2
Please login to post comments