您好我从django 0.96升级到1.2并且知道“之前”和“之后”html选项之间没有其他区别将不再显示。我知道这个信息有点短,但也许你可以知道发生了什么? 之前:
在
除了升级djagno dsipatcher之外,似乎完全相同的一些代码是:
<div id="searchmain">{% include "form.html" %}</div>
和form.html
{% load i18n %}
<form action="/li" id="cse-search-box"><div><input value='{{q}}' type="text" id="searchtext" name="q" size="31" />
<input type="hidden" value='{{t}}' name="t" />
{% include "../market/categories.html" %}
{% ifequal logo "montao" %}
<select name="l" id="search_area" class="search_area"><option value=''>{% trans "Entire" %}</option>
<!--
<option id='heading2'>{% trans "name" %}</option> -->
<option id='heading2'>São Paulo</option>
<option id='heading2'>Rio de Janeiro</option>
<option id='heading2'>Espírito Santo</option>
<option id='heading2'>Minas Gerais</option>
<option id='heading2'>Paraná</option>
<option id='heading2'>Santa Catarina</option>
<option id='heading2'>Rio Grande do Sul</option>
<option id='heading2'>Bahia</option>
<option id='heading2'>Pernambuco</option>
<option id='heading2'>Ceará</option>
<option id='heading2'>Rio Grande do Norte</option>
<option id='heading2'>Amazonas</option>
<option id='heading2'>Distrito Federal</option>
<option id='heading2'>Pará</option>
<option id='heading2'>Maranhão</option>
<option id='heading2'>Goiás</option>
<option id='heading2'>Paraíba</option>
<option id='heading2'>Alagoas</option>
<option id='heading2'>Piauí</option>
<option id='heading2'>Mato Grosso</option>
<option id='heading2'>Mato Grosso do Sul</option>
<option id='heading2'>Sergipe</option>
<option id='heading2'>Rondônia</option>
<option id='heading2'>Tocantins</option>
<option id='heading2'>Acre</option>
<option id='heading2'>Amapá</option>
<option id='heading2'>Roraima</option>
</select> {% endifequal %}
<!--
<input type="hidden" id="lat" name="lat" size="35" maxlength="50" value="{{plat}}" />
<input type="hidden" id="lon" name="lon" size="35" maxlength="50" value="{{plon}}" />
-->
<input type="submit" id="searchbutton" value="{% trans "Go" %}" />
</div></form>
已更新至此问题,但问题仍然存在:
{% load i18n %}
<form action="/li" id="cse-search-box"><div><input value='{{q}}' type="text" id="searchtext" name="q" size="31" />
<input type="hidden" value='{{t}}' name="t" />
{% include "../market/categories.html" %}
{% ifequal logo "montao" %}
<select name="l" id="search_area" class="search_area"><option value=''>{% trans "Entire" %}</option>
<!--
<option >{% trans "name" %}</option> -->
<option >São Paulo</option>
<option >Rio de Janeiro</option>
<option >Espírito Santo</option>
<option >Minas Gerais</option>
<option >Paraná</option>
<option >Santa Catarina</option>
<option >Rio Grande do Sul</option>
<option >Bahia</option>
<option >Pernambuco</option>
<option >Ceará</option>
<option >Rio Grande do Norte</option>
<option >Amazonas</option>
<option >Distrito Federal</option>
<option >Pará</option>
<option >Maranhão</option>
<option >Goiás</option>
<option >Paraíba</option>
<option >Alagoas</option>
<option >Piauí</option>
<option >Mato Grosso</option>
<option >Mato Grosso do Sul</option>
<option >Sergipe</option>
<option >Rondônia</option>
<option >Tocantins</option>
<option >Acre</option>
<option >Amapá</option>
<option >Roraima</option>
</select> {% endifequal %}
<!--
<input type="hidden" id="lat" name="lat" size="35" maxlength="50" value="{{plat}}" />
<input type="hidden" id="lon" name="lon" size="35" maxlength="50" value="{{plon}}" />
-->
<input type="submit" id="searchbutton" value="{% trans "Go" %}" />
</div></form>
我会尝试你能提出的任何建议!谢谢。 BTW这是我可以粘贴的预期输出,没有动态:
<div id="searchmain"> <form action="/li" id="cse-search-box"><div><input value='' type="text" id="searchtext" name="q" size="31" /> <input type="hidden" value='' name="t" /> <select name="cg" id="cat" class="search_category"> <option value='' >All</option> <option value='' style='background-color:#dcdcc3' id='cat1' >-- VEHICLES --</option> <option value='2' id='cat2' >Cars</option> <option value='3' id='cat3' >Motorcycles</option> <option value='4' id='cat4' >Accessories & Parts</option> <!--<option value='5' id='cat5' >Other vehicles</option>--> <option value='' style='background-color:#dcdcc3' id='cat6' >-- PROPERTIES --</option> <option value='7' id='cat7' >Apartments</option> <option value='8' id='cat8' >Houses</option> <option value='9' id='cat9' >Commercial properties</option> <option value='10' id='cat10' >Land</option> <option value='' style='background-color:#dcdcc3' id='cat11' >-- ELECTRONICS --</option> <option value='12' id='cat12' >Mobile phones & Gadgets</option> <option value='13' id='cat13' >TV/Audio/Video/Cameras</option> <option value='14' id='cat14' >Computers</option> <option value='' style='background-color:#dcdcc3' id='cat15' >-- HOME & PERSONAL ITEMS --</option> <option value='16' id='cat16' >Home & Garden</option> <option value='17' id='cat17' >Clothes/Watches/Accessories</option> <option value='18' id='cat18' >For Children</option> <option value='' style='background-color:#dcdcc3' id='cat19' >-- LEISURE/SPORTS/HOBBIES --</option> <option value='20' id='cat20' >Sports & Outdoors</option> <option value='21' id='cat21' >Hobby & Collectables</option> <option value='22' id='cat22' >Music/Movies/Books</option> <option value='23' id='cat23' >Pets</option> <option value='' style='background-color:#dcdcc3' id='cat24' >-- BUSINESS TO BUSINESS --</option> <option value='25' id='cat25' >Professional/Office equipment</option> <option value='26' id='cat26' >Business for sale</option> <option value='' style='background-color:#dcdcc3' id='cat27' >-- JOBS & SERVICES --</option> <option value='28' id='cat28' >Jobs</option> <option value='29' id='cat29' >Services</option> <option value='30' id='cat30' >Events & Catering</option> <option value='' style='background-color:#dcdcc3' >--</option> <option value='31' id='cat31' >Others</option> </select> <!--
<input type="hidden" id="lat" name="lat" size="35" maxlength="50" value="" /> <input type="hidden" id="lon" name="lon" size="35" maxlength="50" value="" />
--> <input type="submit" id="searchbutton" value="Go" /> </div></form> </div>
答案 0 :(得分:1)
我不知道它是否适用于您的问题,但您不能拥有具有相同id
属性的2个元素。 id
必须是独一无二的!如果您需要为2个元素提供相同的样式,那就是class
属性的作用。
是的,它可能导致问题。