I want to do this as well but for the states ( I changed name of State to Kaza in the figure), but I think I am missing something or the list name is wrong, does anyone know what is the correct name fore the States list if I want to add it to my code
code I am trying to change that was inspired from the code above:
Thank you! The list is now populated
I do have one more question, do you have any idea why the selected value isn’t being saved into the database? is there some other line of code that should be edited with the one mentioned above?
The form field name in the Address book is form_state. You need to make your generated select statement have the same form name in order for the data to save properly. I believe in your example its the form_abook_state in the first argument, but don’t know for sure, so you’d need to test it out.
I’ve been meaning to get around to having the address book state and country lookup use the standard openemr dropdowns. If you have this working, it would be great to contribute your code to OpenEMR via a pull request.