简体   繁体   English

使用烧瓶wtforms中的SubmitField与html提交按钮的优缺点是什么?

[英]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.

相关问题 使用flask和wtforms在单个页面中的多个提交按钮 - Multiple submit button in a single page using flask and wtforms 使用Jython / IronPython / Pyjamas有哪些优点/缺点? - What are the advantages/disadvantages of using Jython/IronPython/Pyjamas? 如果和内联如果,有哪些优缺点? - If and Inline if, what are the advantages and disadvantages? 加载代码的require和import方法有哪些优点和缺点? - What are the advantages and disadvantages of the require vs. import methods of loading code? 单击提交按钮后,flask-wtforms 会显示一个弹出窗口 - flask-wtforms show a popup after clicking on submit button Web 应用程序:Flask - html - wtforms:带有两个提交按钮的表单 - Web application: Flask - html - wtforms: form with two submit buttons 如何从 WTForms 中的提交按钮显示模式? - How to display a modal from a submit button in WTForms? validate_on_submit始终使用Flask WTForms返回false - validate_on_submit always returns false using Flask WTForms 在 html Flask WTForm 中动态更改 SubmitField 的标签/值 - dynamically change SubmitField's label/value in html Flask WTForm flask form.validate_on_submit() 使用 wtforms 失败 - flask form.validate_on_submit() fails using wtforms
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM