[英]What are the advantages/disadvantages of using a SubmitField from flask wtforms vs a html submit button?
I am creating Login, Signup, and a few other forms which require the user to click on a submit button. 我正在创建“登录”,“注册”和其他一些表单,这些表单需要用户单击“提交”按钮。 What is the difference between using a SubmitField
in my form class vs using html <input type="submit" value="Log in">
? 在表单类中使用SubmitField
与使用html <input type="submit" value="Log in">
SubmitField
<input type="submit" value="Log in">
之间有什么区别? Which should I prefer and when? 我应该选择哪个时间?
I initially created with html because I was unaware of the SubmitField
option in wtforms. 我最初使用html创建,因为我不知道SubmitField
中的SubmitField
选项。
WTForms SubmitField will create required HTML code ( field value, name, label etc.. ) ( you can apply styles also ). WTForms SubmitField将创建所需的HTML代码(字段值,名称,标签等。)(您也可以应用样式)。 In your HTML, you've to write all these. 在HTML中,您必须编写所有这些内容。
You can use any of these. 您可以使用任何这些。 It all comes to how you're getting data from form and processing it in the backend. 一切都与您如何从表单获取数据并在后端处理数据有关。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.