Validate Radio Button AngularJS

后端 未结 4 1884
Happy的楠姐
Happy的楠姐 2020-12-04 20:32

This seems like it should be fairly easy, but I\'m not finding the answer. I have a form where I need to validate that a selection has been made from a radio group. I trie

4条回答
  •  情话喂你
    2020-12-04 21:09

    Alternative solution using a directive. Accepted answer didn't work for me in Firefox (v 33.0).

    The idea was to set the required attribute to false on all radios with a specific class name, on change.

    • jQuery was added because I was having trouble with the jqlite remove attribute function.
    • I copied as much as possible from the original plunker.

    http://plnkr.co/edit/nbzjQqCAvwNmkbLW5bxN?p=preview

    
    
    
      
      Example - example-radio-input-directive-production
      
      
    
    
      
      
    color = {{myObject.color | json}}

提交回复
热议问题