Material: md-radio-group: required doesn't work

Created on 27 Jan 2015  路  29Comments  路  Source: angular/material

The required and ng-required attributes do not seem to work with md-radio-group

- Lots of Comments won't fix enhancement

Most helpful comment

This seems broken again.

All 29 comments

Put the attributes on each individual <md-radio> element.

@ajoslin Can you take a look at this example I've shown both ways and neither one seems to work. Maybe I'm doing something wrong otherwise can we reopen this.

use ng-required="true" instead of HTML 5 required on the md-radio-group.

Adding ng-required="true" to md-radio-group indeed works, though not clear how to show the error message for it, since ng-messages aren't triggered until a user interacts with the input field and once he/she does, it's no longer invalid. Any clues are appreciated.

@ajoslin Can you reopen this it doesn't work in 0.8.3. I just tried @demisx suggestion and I retried what I did in my examples and none of them work.

Also #1456 is related

This seems to be broken again... required nor ng-required is working.. Please reopen

This seems broken again.

Sorry, forgot the Pen showing required + ng-required on group and button.

+1

+1
See the above codepen by harpritt.

+1

Im pretty sure you are talking about the browsers built in form validation. But it can easily be solved with Angulars form validation*. The problem with the ng-messages not triggering still remains and browser validation will still not work. But it keeps the form from being submitted.

Demo: Codepen

  • ng-required on each button will still not work but the rest do.

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

Please open a new issue with a CodePen demo of the problem that you are seeing. Also please use the 馃憤 reactions and avoid posting +1 in comments.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ddimitrop picture ddimitrop  路  3Comments

ghost picture ghost  路  3Comments

buzybee83 picture buzybee83  路  3Comments

nikhildev picture nikhildev  路  3Comments

rtprakash picture rtprakash  路  3Comments