簡體   English   中英

使用 django 提交按鈕在 html 中不起作用

[英]Submit button is not working in html using django

HTML 文件

在 html 未添加頁面操作我想知道如何在不添加操作屬性的情況下提交表單?

只需在表單標簽中添加您的提交

<form method="post">
   {% csrf_token %}
   {{form.as_p}}
   <input type="submit" value="submit" class="btn btn-primary"/>
</form>

如果您不希望這樣,請在提交中使用form=

<form method="post" id="this_form">
   {% csrf_token %}
   {{form.as_p}}
 </form>
<input type="submit" form="this_form" value="submit" class="btn btn-primary"/>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM