I have a large django form. It has a lot of data that depends on a field being selected.
Eg:
Do you have a car? YES/NO dropdown box.
If yes, I want to show the additional fields make/model/year/cc etc etc
If no, I want to keep them hidden.
What is the best way to this? A simple show/hide div using jquery or is there something better that I should be doing?
Yes, you should use a simple show/hide with JQuery on the client side.
Then on the server side, you would need conditional validation in your form’s
cleanmethod, if you also want to make some fields required only if something else is selected.For example: