Add Value in Dropdown Box

Dear Support Team,

I want to some value in dropdown box of User’s Form, please guide me how to add it? for reference I have attach image.

Thanks in Advanced.

I haven’t seen these fields in user forms before. Are these all custom fields? I yes, why don’t you use Gibbon’s family management system to keep info like this?

Hi vishalr, it looks like you may be editing the Emergency Contact section, with a string replace for the name. The relationship field offers a number of different options which are pre-defined in the system, there isn’t an easy way to edit these. One way to specify other relationships is to add it in brackets after the name of the contact. Otherwise, if there’s a relationship type missing from the list feel free to let us know and we may be able to add it.

@ross can i add these value from database?

I want to add these two relationship in list

1.Grand Parents
2.Guardian

Maybe this one can help.

https://ask.gibbonedu.org/discussion/2698/php-how-to-change-items-in-a-dropdownlist-how-to-create-a-new-list#latest

Hi vishalr,

I’ve taken a look at the relationship options and I think these would be good options to add to Gibbon. The goal for emergency contacts is to list people who are not already parents or family members listed in Gibbon, so grandparents would be a good option to have.

I’ve made this change in the v21 development branch, which you can see here: https://github.com/GibbonEdu/core/commit/19efcc276d2502a93b08a2a206fb330e2bc77ccc You can apply the change to your own install by making the same code changes to src/Forms/FormFactory.php

Thanks!

Thank you very much @ross

Hi @ross

from this file https://github.com/GibbonEdu/core/commit/19efcc276d2502a93b08a2a206fb330e2bc77ccc , you’ve made since V21. If I want to add " Aunty, Uncle", I just add:
‘Aunty’ => __(‘Aunty’),
‘Uncle’ => __(‘Uncle’),

Also may be Brother, Sister?

Thank you for your kind reply.

I think for many cases the Other Relation option could work for this, but you’re certainly welcome to add it to your own system. Keep in mind that changes like these will be overwritten when you update your system, so you may have to re-do the changes each update.