Answer the question
In order to leave comments, you need to log in
When receiving data via getlist, I can't get variables in a loop?
When receiving data via getlist, I cannot get variables in a loop.
<input type="hidden" id="list_id" name="list_id" value="1,2,3,4,5,6,7,8,9,10">
list_id = request.form.getlist('list_id')
for i in list_id:
print(type(i))
print(i)
<class 'str'>
1,2,3,4,5,6,7,8,9,10
<class 'str'>
1
<class 'str'>
2
<class 'str'>
3
<class 'str'>
4
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question