嗨,我有一个按钮,需要根据条件启用或禁用。 需要禁用时,我需要显示一条消息。但是,JavaScript会多次触发,因此多次显示该消息只需显示一次。如何防止Javascript被多次触发
下面是一个调用JavaScript函数的标记: -
<button type="submit" class="btn btn-save nm" ng-click="controller.saveOpportunity()" ng-disabled="!(controller.canDealBeClosedByFeeAllocationStatus() && controller.isEnabled('SaveOpportunity'))">
<svg><use xlink:href="../Content/images/c/svg-defs.svg#circle-check"></use></svg>
Save
</button>
下面是JavaScript函数: -
canDealBeClosedByFeeAllocationStatus:()->
if this.isReibDeal() && this.data.OpportunitySalesStageIsClose() == true
if this.data.FeeAllocationComplete == false
ShowMessage('warning', 'Fee Allocation needs to be complete')
return this.data.FeeAllocationComplete
else
return true
什么是解决这个问题?