Hello great and awesome developers,
I am creating a Form for a small Political Party to use in registering its members.
From the details that users enter for State, Local Government, and Ward,I need to generate a Unique User ID from these details and append their WordPress assigned ID to the end.
I’ve been able to dynamically enable “limit selection” — in which case, if you select a State, you can only select Local Governments within that State, in the Local Government Dropdown field.
I did this through the “Choices callback” feature in Ultimate Member, seen from here — https://docs.ultimatemember.com/article/1539-choices-callback-feature-in-um-2-1
A BACKGROUND
Each Local Government has Local Government Name and Local Government Code.
Each Ward has Ward Name and Ward code.
For example, Abia State has Abia North as a Local Government, and Abia North Local Government code is 01.
Abia North Local Government has many Wards, and two Wards are listed below with their Ward codes:
Eziama with Code 01.
Osusu with Code 02.
THE PROCESS
1.) Have an array for each Local Government and its Local Government Code.
If a user selects a Local Government in the Dropdown field, auto-populate a Text field called “LGA Code” with the corresponding Local Government Code.
2.) Have an array for each Ward and its Ward Code.
If a user selects a Ward in the Dropdown field, auto-populate a Text field called “Ward Code” with the corresponding Ward Code.
QUESTION
Please, how do I achieve this?
WHAT I HAVE TRIED
I used the “Choices callback” feature in Ultimate Member, seen from here — https://docs.ultimatemember.com/article/1539-choices-callback-feature-in-um-2-1
But this is for selection through a Dropdown field.
Ultimate Member documentation didn’t show us how to auto-populate a Text field with inputs derived from a Dropdown field array.
Special Regards.