Filter an Option Set in custom program registration form

Hi Everyone.

What I would like to do in version 2.28 is design a custom program registration form that filters a drop-down list (configured by an option set) based on the selection of a different form element. So, this…

All of the scripting support for the custom forms seem to be for the data entry app as described
here
.

Am I missing something?

···

Sent from Outlook

Hi Adam,

I hope you have a best solution, I just have an idea which is not really beautiful it based on three steps:

DHIS2 Side : - Create three defaults dataElements (With no options or combo) : Region field, District field and Sous prefecture field.

HTML Side : - Create three Drop-down elements : Region, District and Sous prefecture.

  • Create three text fields (Put here the three dataElement): Region, District and sous prefecture (Not editable by user)

JQuery Side : - Create a json file/variable to host region, district and sous prefecture(This is the big job).

  • Populate the region Drop-down element by regions from json(When the form loaded).

  • When region selected (based on event) :

  • Change region text field value (data element)

*Populate district drop-down by filtering from json variable.

  • When district selected (based on event) :
  • Change district text field value (data element)

  • Populate sous prefecture drop-down by filtering from json variable.

  • When sous prefecture selected (based on event) : Change sous prefecture field value.

Loking forward to hear about the result :slight_smile:

Regards.

Diao

···

On Wed, May 16, 2018 at 10:47 PM, Adam Preston adam704a@hotmail.com wrote:

Hi Everyone.

What I would like to do in version 2.28 is design a custom program registration form that filters a drop-down list (configured by an option set) based on the selection of a different form element. So, this…

All of the scripting support for the custom forms seem to be for the data entry app as described
here
.

Am I missing something?

Sent from Outlook


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com

Hi Adam,

In addition to Diao’s suggestion, instead of creating a json file, you can use the organisationUnits api endpoint with filters to get the organisationUnits hierachy and filter from it as per Diao’s suggestion.

Alex

···

On Wed, May 16, 2018 at 10:47 PM, Adam Preston adam704a@hotmail.com wrote:

Hi Everyone.

What I would like to do in version 2.28 is design a custom program registration form that filters a drop-down list (configured by an option set) based on the selection of a different form element. So, this…

All of the scripting support for the custom forms seem to be for the data entry app as described
here
.

Am I missing something?

Sent from Outlook


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com