Using AngularJS v1.6.6.

I have a set of radio buttons and I'm using the code below and I can't get 
the ng-messages to display when I click the Submit button if a radio button 
has not been selected. The code below does not work.

<div class="p fcRadio fcRequired" id="a10000000Radio">
  <label class="control-label" for="a10000000Radio">Required radio button 
list</label>
  <label for="abcradio1">
    <input class="li" id="abcradio1" ng-model="abcradio" 
ng-readonly="formComplete==true" type="radio" name="abcradio" value="Radio 
button 1" required="">Radio button 1</label>
  <div ng-messages="form.abcradio1.$error" ng-show="(form.$submitted || 
form.abcradio1.$touched) &amp;&amp; form.abcradio1.$invalid-required">
    <div ng-messages="required" style="color: red;">Radio button is 
required.</div>
  </div>
  <label for="abcradio2">
    <input class="li outside" id="abcradio2" ng-model="abcradio" 
ng-readonly="formComplete==true" type="radio" name="abcradio" value="Radio 
button 2" required="">Radio button 2</label>
</div>

But a similar setup like below works for checkboxes:

<div class="p fcCheck fcRequired">
  <label class="control-label" for="a1000000Check">Required check 
box</label>
  <input type="checkbox" name="a1000000Check" id="a1000000Check" 
ng-model="a1000000Check" ng-readonly="formComplete==true" required="">
    <div ng-messages="form.a1000000Check.$error" ng-show="(form.$submitted 
|| form.a1000000Check.$touched) &amp;&amp; 
form.a1000000Check.$invalid-required">
      <div ng-messages="required" style="color: red;">Checkbox is 
required.</div>
    </div>
</div>

Thanks,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/789a8b7a-14b4-4bd6-bde2-5c7237f59643%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to