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"); 


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

java - How to implement an entity bound odata action in olingo v4.3 -