Retrieving values of non input fields with Flask

johanbokar

New Member
Probably a stupid question, but I can't work out how to retrieve the values of anything other than input fields using python with Flask. For example, I have an html form with a element:\[code\]<form action="/newgame" method="POST"> <input type="text" name="white"><select> <option name="result" value="http://stackoverflow.com/questions/14551050/onezero">1-0</option> <option name="result" value="http://stackoverflow.com/questions/14551050/zeroone">0-1</option> <option name="result" value="http://stackoverflow.com/questions/14551050/draw">draw</option></select><input type="text" name="black"><input type="submit" value="http://stackoverflow.com/questions/14551050/submit"></form>\[/code\]On serverside, if I call \[code\]print request.form.items(True)\[/code\], then I can retrieve the values from the two \[code\]<input type="text">\[/code\] elements, but not from the \[code\]<select>\[/code\] element.I had a similar issue where I wanted to have a form with two submit buttons and then work out on the serverside which button had been used to submit the form. I had no luck with this either.Help and advice appreciated.
 
Back
Top