Answer the question
In order to leave comments, you need to log in
How to parse multilevel forms?
There is a three-level form, like:
--- Select1:
option_1
option_2
option_...
option_50
--- Select2:
option_1
option_2
option_...
option_35
--- Select3:
option_a
option_b
option_...
option_z
Answer the question
In order to leave comments, you need to log in
If the elements of the selects can be arbitrarily combined with each other, i.e. each with each, then everything is very simple, we get the form data, no matter how, a simple or ajax request, we combine all the elements, then we send a request for each combination. piece of code to understand the principle:
print([[x, y, z] for x in range(3) for y in range(3) for z in range(3)])
# ну или на привычных циклах
res = []
for x in range(3):
for y in range(3):
for z in range(3):
res.append([x, y, z])
print(res)
working with AJAX +
While - if you can't
For - if you can
pick up the parameters
Do the values for Select2 depend on the selected option in Select1? Do Select3 values depend on the selected option in Select2? It is possible stupidly by a banal enumeration method.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question