How to Change Dropdown to a Lookup/popup form?

I want when select Realtor its not a dropdownlist but a textbox with a button. If button click will show datatable with realtor data and i can search realtor from that form. if click select button, selected realtor will be a foreignKey for the Listing.

class Listing(models.Model):
realtor = models.ForeignKey(Realtor,on_delete=models.CASCADE)
title = models.CharField(max_length=200)
address = models.CharField(max_length=200)

class Realtor(models.Model):
name= models.CharField(max_length=200)

Suggestions are welcome.

It’s either going to be a page refresh if you want Django to do this, or else you’ll need to supply some JavaScript to do this in the browser.

If Django’s doing this, then you’re creating two pages, one for each type of input form and using your button to select between them.