dimanche 2 octobre 2016

Checkbox list with booleen

I've tried too many script and now I'm confused.

How can I take boolean value from take from a loop

for i in range(int(NbrPoste)):
                print "<p>Poste "+str(i+1)+" :</p>"
                for x in range(int(NbrEquipe)):


                    print "<input id='Checkbox"+str(b)+ "' type='checkbox' name=membre[] value=''/>"
                    # print "<input type='hidden' id='Hidden" + str(b) + "'  name='membre[]' value='' />"

                    print "<input name='poste[]' type='text'>"+str(result_member[x][0])+"</input>"
                    b=b+1


            print "<input type='submit'>"
            print "</form>"
            print "<script>"
            for i in range(int(b)):
                print "$('#Checkbox"+str(i)+"').on('change', function(){"
                print "this.value = this.checked ? 1 : 0;"
                print "// alert(this.value);"
                print "}).change();"
                # print "if ($('#Checkbox"+str(i)+"').is(':checked')) {"
                # print "document.getElementById('#Hidden"+str(i)+ "').value = '1';"
                # print "}

            print "</script>"

my code look like this




Aucun commentaire:

Enregistrer un commentaire