Using Yii, I have a form for creating an instance of a model. I'm submitting the form via a vanilla HTML POST rather than ng-submit. I currently have:
<form>
...
<div ng-repeat="category in dashboard.allCategories" class="category-radio-wrap" ng-model="dashboard.category">
<input id="radio-cat-{{category.id}}" type="radio" name="Activities[category]" value="{{category.id}}">
<label for="radio-cat-{{category.id}}">
<div class="color-spot" style="background-color:{{category.color}};border-color:{{darken(category.color)}}"></div>
<span class="label-text">{{category.title}}</span>
</label>
</div>
...
</form>
But when I submit the form, these radio buttons aren't posted. All of my other fields, not generated via Angular, are. Furthermore, if I switch this out for a PHP for-loop, like so:
$cats = \app\models\Categories::find()->all();
foreach($cats as $cat) {
echo '<div class="category-radio-wrap">';
echo '<input id="radio-cat-'.$cat->id.'" type="radio" name="Activities[category]" value="'.$cat->id.'">';
echo '<label for="radio-cat-'.$cat->id.'">
<div class="color-spot" style="background-color:'.$cat->color.';border-color:'.$cat->color.';"></div>
<span class="label-text">'.$cat->title.'</span>
</label></div>';
}
...they post just fine. I could do this, but since I have to make the request for the JS array as it stands, it would be nice to use that instead of running another query, not to mention I lose my border-darkening JS function going the PHP route as well. Any thoughts on why these aren't submitting and how to resolve it?