Skip to content
Advertisement

Handle Multiple Checkboxes with a Single Serverside Variable

I have the following HTML code:

JavaScript

And then ideally I would like to have the following python serverside code:

JavaScript

I tried doing this by making the HTML sports_played name and array, sports_played[], but that didn’t do anything and right now it just always returns the first selected item.

Is this possible? Really I just don’t want to have to do a self.request.get(‘HTML_item’) for each and every checkbox incase I need to alter the HTML I don’t want to have to change the python.

Thanks!

Advertisement

Answer

The answer is shown in the webapp2 docs for the request object:

JavaScript

Alternatively you can use

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement