Hi David,

The functionality you are interested in is called as *Cascading Dropdown*.

Below are few examples recommended by Bing Chat powered by GPT-4:

   - django-cascading-dropdown-widget ยท PyPI 
   <https://pypi.org/project/django-cascading-dropdown-widget/>: This is a 
   package that provides a cascading-dropdown widget for django. It allows you 
   to create a dropdown list that depends on the selection of another dropdown 
   list. It has examples of how to use it with different models and choices 
   generators.
   - How to Create Cascading Dropdown List in Django python 
   
<https://labpys.com/how-to-create-cascading-dependent-dropdown-list-in-django-python/>:
 
   This is a tutorial that shows how to create a cascading/dependent dropdown 
   list in django python using jQuery. It has the code for creating the 
   models, views, urls, and template for the application.
   - Django/jQuery Cascading Select Boxes? - Stack Overflow 
   
<https://stackoverflow.com/questions/3233850/django-jquery-cascading-select-boxes>:
 
   This is a question and answer thread that discusses how to create cascading 
   select boxes in django using jQuery. It has some suggestions of how to use 
   hidden fields, ajax calls, and custom widgets to achieve the desired 
   functionality.
   - Cascading Dropdowns using Javascript - Stack Overflow 
   
<https://stackoverflow.com/questions/57014605/cascading-dropdowns-using-javascript>:
 
   This is another question and answer thread that explains how to create 
   cascading dropdowns using javascript. It has a simple example of how to use 
   an object to store the options and a function to populate the select 
   elements.


Regards,
SWARUP Selvaraj
On Sunday 3 December 2023 at 01:58:20 UTC+5:30 David Merrick wrote:

> Hi. I can put an item from the database into a select box ie Countries of 
> the World. What I want to know is saying, having chosen New Zealand from 
> the select box, how do I display all the cities of New Zealand in another 
> select box.
>
> The database has two tables. First one is Countries. The second table is 
> cities with populations and the foreign key of Countries table.
>
> Then having chosen Auckland a city in New Zealand I want to display 
>
> Country
> City
> Population 
>
> In a template.
>
> I have done this in Php, Javascript and Mysql already.
>
> Cheers Dave
>
>
> -- 
> Dave Merrick
>
> TutorInvercargill
>
> http://tutorinvercargill.co.nz
>
> Daves Web Designs
>
> Website https://tutorinvercargill.co.nz/daveswebdesigns/public_html/
>
> Email merri...@gmail.com
>
> Ph   03 216 2053
>
> Cell 027 3089 169
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ba2f3e0e-a8e6-466b-aec3-bc12a728e270n%40googlegroups.com.

Reply via email to