I have a form where there are some required inputs that are not within the form tag. The form is validating even though these inputs are not valid.
How can I fix this without moving all inputs inside the form tag?
Specifically I need to have the form be invalid when any inputs associated with the form are invalid. Not just those contained within the element.(i.e. any input with it's form attribute pointing to the form)
example:
<div class="radio-group">
<input type="radio" form="testForm" name="test2" value="a" ng-model="formData.test2" ng-required="true">
<input type="radio" form="testForm" name="test2" value="b" ng-model="formData.test2" ng-required="true">
</div>
<form name="testForm">
<div class="radio-group">
<input type="radio" name="test1" value="a" ng-model="formData.test1" ng-required="true">
<input type="radio" name="test1" value="b" ng-model="formData.test1" ng-required="true">
</div>
<input type="submit" value="submit" ng-disabled="testForm.$invalid">
</form>
ngForm?