私が第一にtextInputまたは第二にtextInputを表示するための条件がある場合に便利です同じ形で二度同じフィールドを生成したい: Djangoは生成されます。Django:同じフォームにフィールドを2回表示するために重複したHTML IDを避けるにはどうしたらいいですか?
<!--same form -->
<input type="radio" value="good_price"/> <!-- show good price if this is checked -->
<input type="radio" value="bad_price"/> <!-- show bad price if this is checked -->
<!--1st -->
Good price <input id="id_name"..../>
<input id="options_with_good_price"/>
<!--2nd -->
Bad Price <input id="id_name".../>
<input id="options_with_bad_price"/>
をので、重複するHTMLのidがあり、どのようにそれを避けるために?
{{ form.element|attr:"id:another_name" }}
:あなたは
{{ form.element }}
を使用している場合は、次の操作を行うことができます
どのようにこのフォームを生成していることで
=
を変えましたか? –