Refreshing dropdown after modal form closes

How to refresh a dropdown as soon as a new value is added to the linked FK field in a form?

View ‘EntryView’ has got a dropdown field.
there is button next to that field to enable the user adding new values to that dropdown.

<button type="button" class="btn btn-secondary mb-3" hx-get="{% url 'entry:add-new' %}" hx-target="#dialog" class="btn btn-dark">
                                                  <i class="fa fa-plus"></i>

By clicking that button a modal form will be opened to get the inputs from user. On clicking ‘Save’ of that modal form, value is getting saved to the corresponding table. Only upon the page refresh can the user see the newly added value. (Using Django Htmx modal)
We would like that dropdown/form to be refreshed as soon as the ‘Save’ button is clicked.
Even if there would be a solution to make that newly added value appear on the dropdown as soon as the ‘Save’ button on modal form is clicked, that would be very useful.
Request help for the same. - Thank you!


app_name = 'entry'
urlpatterns = [

def AddView(request): 
    addForm = AddForm(request.POST or None)
    if request.method == "POST":
        if addForm.is_valid():
            return HttpResponseRedirect(reverse('entry:entries'))  
            addForm = AddForm()
    context = {
        'addForm': addForm
    return render(request,"entry/addNew.html",context)

def EntryView(request):   
    entryFields = Entry.objects.all() 
    entryForm = EntryForm(request.POST or None)

    if request.method == "POST":     
        if entryForm.is_valid():
            return HttpResponseRedirect(reverse('entry:entries'))
            entryForm = EntryForm()
            return render(request,"entry/entry.html",{ 
    context = { 
        'entryForm': entryForm,
        'entryies': entryFields
    return render(request,"entry/entry.html",context)

If you’re using htmx on the modal submit, this is rather easy.

In your view processing that submission, render the new dropdown field with the additional data, and include that div in your HTTP response as an oob update.

Could any samples be shared for the same? I did use hx-trigger, not any with oob in ‘modal’ forms.

Tried some solution. Still stuck. Posted the further issue here: