加载此表单时,我会重置单选按钮'价值为null
因此,如果用户没有选择该值,我可以告诉您。
如何将单选按钮设为必填字段?
HTML:
<div class="form-group col-md-6" ng-show="showrRiskAccpt">
<div>
<label class="control-label" for="riskAcceptance">Risk Acceptance</label>
</div>
<div>
<input type="radio" id="riskAcceptanceDec" value="Y"
ng-model="processRating.riskAcceptanceFlag"
ng-change="showRationalCmmt()"
ng-required="showrRiskAccpt = true"
data-required-msg="Risk Acceptance is required">Yes
<input type="radio" id="riskAcceptanceDec" value="N"
ng-model="processRating.riskAcceptanceFlag"
ng-change="showRationalCmmt()"
ng-required="showrRiskAccpt">No
</div>
</div>