Hi All;
Please forgive me if this is covered somewhere that I have not found. If so, a link or a search term to find it would be truly appreciated.
I need to customize the moodle registration page (moodle v2.3.1+ with skillsoft mod), such that my "Other" fields that I have added to the page, using the moodle admin capabilities, can use dynamic dependendent dropdown lists. So for example, I want to be able to have a dropdown with choices of "Employee" or "Contractor". If Employee, one dd list appears, if Contractor, another dd list appears or is populated with the correct choices to match the selected choice (employee or contractor). I have 3 pairs that I need to apply this to.
I found on the forums a piece about the enhancement for dynamic dependendant dropdowns on the "Add community course" page. The problem I have here is it seems these dependencies are built upon fields that are always on the page, rather than the dynamically added "other" fields that I am trying to make this work on. The other problem I have here is this is based on building tiered lists rather than showing next selection only if correct choice is made in first selection.
I see a few ways this can be done, but am hoping someone can point me to the best solution, or a solution/enhancement that has already been built. The scenarios I see are:
1. Write code similar to what is in the enhancement for the "Add community course" page, but put it on the new registration page and have it go in the setion where the "other" fields are being generated, using an if/then/else statement to determine which fields it will apply to. I would also need to modify it to make the fields appear/populate based on the correct choices, but could live with the "tiered" style as well.
2. Get a js into the header of that page to provide me with the dynamic dependendant dropdowns, using scripts that are already available (I remember seeing somewhere in the moodle admin, a place to insert calls to js, but don't know if this is appropriate nor do I remember where that is).
3. Make the "other" fields I am using, permanenet fields on the registration page, and then apply the "enhancement" mentioned above.
Any thoughts, tips, pointers, links, help, etc. very much appreciated. This is my first project in moodle, but I have a lot of experience in php as well as several other languages.
Thanks
W