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 ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…