M
M
maniacus262019-01-09 17:31:26
JavaScript
maniacus26, 2019-01-09 17:31:26

Is it possible to change the form content (several different fields) depending on the value in one of the fields?

Greetings!

There is a model in DJANGO, it has 20 fields (optional
) B - other two fields, for C - other 5 fields.

You need to either hide / open fields depending on the choice (as in this case, clear the filled fields if the user changes his mind and changes the value in the selector by filling in other fields) or display all fields but make them unavailable for filling, or connect a validator that will give an error if it is filled a field that does not need to be filled in (how can the validator specify multiple conditions for each field?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Shatalov, 2019-01-09
@netpastor

If you do not want to show / hide fields using the front, then try splitting the form into several
https://django-formtools.readthedocs.io/en/latest/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question