【发布时间】:2013-05-31 17:47:33
【问题描述】:
我在我的应用程序中使用了地图 api。对于选择标记,名为“Add marker”和“Refresh map"”的按钮用于刷新地图。我正面临着这里。
保存数据后,保存按钮将重定向到下一页。在我的情况下,“添加标记”,"Refresh map" 都在执行保存按钮工作,如果我按下 "Add marker" 而不是显示标记,页面被重定向到下一页。这是在使用 </form> 后发生的。在此处查看我的模板,
<form method="POST" action="/member/where/" >
{% csrf_token %}
<td colspan="2" class="incident-type" style="padding-left:25px">
{% for location in locationList%}
{% if location.parent_location_id == None %}
<h1>{{location.title}}</h1>
{% endif %}
{% endfor %}
<p>
<span class="map_buttons" >{% include "buttons/refreshmap.html" %}</span> <span class="map_buttons" style="margin-left:20px;">{% include "buttons/addmarker.html" %} </span>
</p>
<p id=ir-nextbtn>{% include "buttons/next.html" %}</a></form></p>
刷新标记.html
<button type="submit" title="Refresh map" class="map_buttons button_style">Refresh map</button>
addmarker.html
<button type="submit" title="Add marker" class="map_buttons button_style">Add marker</button>
需要澄清这个问题。
【问题讨论】:
-
你能粘贴按钮的html吗?两个按钮都是提交按钮吗?
-
@Rhea,均为 html,已更新。
标签: python html django django-forms django-templates