Form field filter

17 views
Skip to first unread message

Sergio Alves

unread,
Feb 19, 2023, 9:53:07 PM2/19/23
to Django users
I would like to know a way to filter a form field according to the option in another field of the same form.
Example:
I have a field 'tipo_pet' that can be 'dog' or 'cat', and another field called 'vaccine', so I want the vaccine field to be filtered according to the type of pet, vaccines for dog if the type of pet is dog or cat vaccines if the type of pet is cat.
How to do this?
I'm using Class-based views.

Sergio Alves
Reply all
Reply to author
Forward
0 new messages