S
S
sabotage_kyrazh2021-02-26 00:28:55
Flask
sabotage_kyrazh, 2021-02-26 00:28:55

How to get a variable from a checkbox in Flask?

Good day to all. I'll try to write it out in full.

I need to create a simple questionnaire, which will have about 10 items on one page. There will be checkboxes next to the corresponding items. The essence of the questionnaire is that the answer should be returned to the page depending on the selected checkboxes. For example, if items 1, 2 and 6 are selected, then one answer is returned, if only 6 then another, if 2, 3 and 9, then another answer is also returned. Since I have a very low level of programming language proficiency, I got into a stupor when processing checkboxes. The response algorithm itself, depending on the selected values, I implemented in Python through if else, while the algorithm uses variables that are either 0 or 1.

Please advise how best to implement this task? I see it in such a way that the form sends the value of the checkboxes to the back and is already processed by the algorithm there. At the same time, if so, then I could not figure out how to process unpressed checkboxes. Perhaps there is a better solution and honestly I would like to know about it.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question