Questions tagged «disabled-control»

6
当表单对AngularJS无效时,禁用提交按钮
我有这样的表格: <form name="myForm"> <input name="myText" type="text" ng-model="mytext" required /> <button disabled="{{ myForm.$invalid }}">Save</button> </form> 如您所见,如果输入为空,则该按钮将被禁用,但是当包含文本时,该按钮不会变回启用状态。我该如何运作?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.