如何禁用“提交"按钮? [英] How to make 'submit' button disabled?
本文介绍了如何禁用“提交"按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在表单有效之前禁用提交"按钮?
How to disable the "Submit" button until the form is valid?
angular2是否具有可以在提交"按钮上使用的等效于ng-disabled的功能? (禁用ng的功能对我不起作用.)
Does angular2 have an equivalent to ng-disabled that can be used on the Submit button? (ng-disabled doesn't work for me.)
推荐答案
As seen in this Angular example, there is a way to disable a button until the whole form is valid:
<button type="submit" [disabled]="!ngForm.valid">Submit</button>
这篇关于如何禁用“提交"按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文