I want to implement validation for a radio button field using Angular.js. Below is the code snippet I am working with:
<form name="myForm" enctype="multipart/form-data" novalidate>
<div>
<input type="radio" ng-model="new" value="true" ng-required="!new"> new
<input type="radio" ng-model="new" value="false" ng-required="!new">Old
</div>
<input type="button" class="btn btn-success" ng-click="addData(myForm);" value="Add" ng-show="myForm.$valid"/>
</form>
Currently, I'm facing an issue where the "Add" button is still visible even when the user has not selected any radio button. My attempts at resolving this have been unsuccessful. Any assistance on how to achieve this behavior would be greatly appreciated.