My index.html
looks like this
<form name="myForm" action="" method="post" onsubmit="">
<p>
<input type="radio" name="options" id="option1"> Option1 <br>
<input type="radio" name="options" id="option2"> Option2 <br>
<input type="radio" name="options" id="option3"> Option3 <br>
</p>
<p><input type=submit value=Next></p>
</form>
I need to get the selected button. But since they all have the same name I cannot do it by writing request.form['option']
. If I make their names different, users can make multiple selections.
Isn't there a way to get a button's state by it's id ? If no, what's the simplest way to handle this form ?
400 Bad Request: KeyError:
– Salena