python - I return a dict from the views.py to the templates as a value of a radio, but it looks like the "value" would cut down the text -
this templates,test_words.html
<form action="" method="get"> <input type="radio" name ="option" value={{pre_ques.option1}}> {{pre_ques.option1}}</label> <input type="radio" name ="option" value={{pre_ques.option2 }}> {{pre_ques.option2}}</label> <input type="radio" name ="option" value={{pre_ques.option3 }}>{{pre_ques.option3 }}</label> <input type="radio" name ="option" value={{pre_ques.option4 }}>{{pre_ques.option4 }}</label> <input type="submit" class="btn btn-primary btn-lg btn-block" name="next" value="show next"> </form>
and show in
<label> {{pre_ques.option4 }}</label>
bu, if try
option_value = request.get.get('option') return httpresponse (option_value)
it show part of {{pre_ques.option4}}, show "a." or "n.".
but,it should "n. 疏远,离间,割让" problem cause ?
you need put value in quotes.
<input type="radio" name ="option" value="{{pre_ques.option1}}">
Comments
Post a Comment