Checkboxes are a bit tricky with web.py, here’s how to get them working:
OK, so that’s a dumb (and untested) example, but it gives you an idea. The ‘theresult’ variable is going to be true or false depending on if the ‘thelovelycheckbox’ was ticked or not.
Things to note:
- There’s a web.py bug which means that you have to give the checkbox a value attribute for them to work.
- To get the result, you must use
.checkedinstead of the normal