angularjs-ng-disabled

disable the button after one click using ng-disabled

[亡魂溺海] 提交于 2020-01-07 03:49:42
问题 Below is the code for the ng-click, I want the click event only once and then disable the button . But, how to use ng-disabled for only button tag (without using input tag)? Suggestion would be really appreciated for the beginner to angularjs. <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"> </script> <body ng-app="myApp"> <div ng-controller="myCtrl"> <p>Click the button to run a function:</p> <button ng-click="!count && myFunc()">OK</button> <p>The

Disable submit button after one click in angularJS

我们两清 提交于 2019-12-24 05:57:27
问题 I would like to disable button after one click. Code: <button id="submitRequest" class="btn btn-primary btn-active" ng-disabled="!frmRequest.$valid||!r.DataUseAgreement||(!chkBMT&&!chkOncore&&!chkCAISIS&&!chkLIMS&&!chkFCR)" ng-click="SaveData()"> <i class="fa fa-save"></i> Submit </button> How to disable this one after one click? Thanks! 回答1: Simple. You write to element a bit of javascript, like onclick="this.disabled=true" . <button id="submitRequest" onclick="this.disabled=true" class="btn

Disable submit button after one click in angularJS

天涯浪子 提交于 2019-12-24 05:57:13
问题 I would like to disable button after one click. Code: <button id="submitRequest" class="btn btn-primary btn-active" ng-disabled="!frmRequest.$valid||!r.DataUseAgreement||(!chkBMT&&!chkOncore&&!chkCAISIS&&!chkLIMS&&!chkFCR)" ng-click="SaveData()"> <i class="fa fa-save"></i> Submit </button> How to disable this one after one click? Thanks! 回答1: Simple. You write to element a bit of javascript, like onclick="this.disabled=true" . <button id="submitRequest" onclick="this.disabled=true" class="btn

How to disable md-select

一世执手 提交于 2019-12-10 15:53:28
问题 I need to disable a md-select but I couln't find it in the Angular documentation. This is my code: <md-select ng-model="idSelectedMonth" placeholder="Month"> <md-option ng-repeat="month in months" ng-value="month.number"> {{month.number}} </md-option> </md-select> 回答1: you can use ng-disabled="true" on md-select tag like below (function () { 'use strict'; var app = angular.module("App",["ngMaterial"]); app.controller("ctrl", [function () { /* jshint validthis: true */ var vm = this; vm.title

How to disable a button in ANGULARJS

牧云@^-^@ 提交于 2019-11-30 08:21:04
问题 i have angularJS 1.5.0-rc.2 I found on the internet that i can use the directive data-ng-disabled="Expression" But it won't disable a button. What i tried : <button data-ng-disabled="false">Select</button> // don't work <button data-ng-disabled="loaded">Select</button> // don't work <button data-ng-disabled="loaded != false">Select</button> // don't work Loaded is defined in my controller as $scope.loaded = false. How can i disable a button ? Thanks 回答1: The button will be disabled only if