Issue in setting the value in select after form success in modal

I have a select person on my webpage which on selecting the value to add shows a modal that adds a person in my select dropdown. Now I want to show the recently added member as the selected value on my select.So I tried setting the value through action and javascript but still not working. Please help me with this.

Hi,
Not sure if I get your question entirely, but hope this helps.
Create a variable and set that as the value of your modal’s select dropdown where you want a default value selected.
On success of add-person, save this person’s id in the new variable.

Assuming your select’s option value binding is ID of persons, you should see the newly added person auto-selected once the modal is opened.