Validation of invisible and disabled fields in AngularJS

后端 未结 3 841
陌清茗
陌清茗 2020-12-29 09:11

Is there any way to do conditional validation in AngularJS? The problem I am trying to solve is basically a list of radio buttons that enable/disable inputs based on the sel

3条回答
  •  既然无缘
    2020-12-29 10:07

    As marmite suggests, ng-required can accept an expression so you can say something like

    
    
    

    I'm not sure on how to check the disabled state - that ought to do it, but I've only ever created this effect by checking the state of a checkbox.

    I realise this is a Lazarus post, but hopefully it will help others.

提交回复
热议问题