angularjs - How to fire fluent Validation only on Reject Button Click -
i using simple angular form fluent validations. having 2 button. 1 save , reject , below have reject reason textbox. in fluent validations using validate reject reason if empty. but problem getting save button click validating reject reason empty. want validate when click reject reason button. rulefor(i => i.rejectreason) .notempty() .withmessage("reject reason required")); what tried having flag when button clicked making flag true can validate message problem after enter reject reason , hit reject button flag still true , validating me message. correct way or how shall validate below have tried rulefor(i => i.rejectreason) .notempty() .when((i) => { return i.showrejectreason; }) .withmessage("reject reason required");