I have a couple of input text field on which I applied required and pattern and I use an anchor tag with ng-click
to save the changes. The styling works well on the UI, when the input value does not meet the requirements the element becomes red. However the user is still able to click on the anchor. I want to be able to do one of 2 things, either disable the anchor when the input elements are not valid or in the saveinfo()
function I want to be able to validate the input values without having to repeat the pattern and or required.
Here's what the html looks like:
<input type="text" ng-model="Name" required pattern="[a-zA-Z -]+" />
<input type="text" ng-model="Description" required />
<a ng-click="saveinfo()"><img src="./img/save.svg" /></a>