S
S
Sama Samsonov2017-01-20 11:23:04
Django
Sama Samsonov, 2017-01-20 11:23:04

How can I check these checkboxes?

chec = request.POST.getlist('checks[]')
checb = request.POST.getlist('checkb[]')
checbo = request.POST.getlist('checkbo[]')
There are 3 checkboxes as one condition checks them ?
if 'checks[]' in request.GET and request.POST['checks[]'].isdigit():
if 'checks[]' in request.GET and request.POST['checks[]'].isdigit( ):
if 'checks[]' in request.GET and request.POST['checks[]'].isdigit():
How to combine these 3 conditions ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Aksenov, 2017-01-20
@hellmin

Some sort of a mix.
in one place a list is returned from request.POST.getlist('checks[]'), and in another place it is checked for a number request.POST['checks[]'].isdigit()

S
sim3x, 2017-01-20
@sim3x

django
forms

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question