Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

In one of my application, I am creating a list of checkboxes from php. Code looks like follows

<?php
   $fullAddons=$this->extras->getAdons($cat_id);
   $inads=array();
?>
<div id="addonsholder" class="width_100">
   <?php 
      foreach($fullAddons as $add){
      $sel=in_array($add->id,$inads) ? 'checked="checked"' : '';
      echo '<div class="checkbox"><input '.$sel.' type="checkbox" value="'.$add->id.'" name="add_ons[]" id="adon_'.$add->id.'" /><label for="adon_'.$add->id.'">'.$add->sub_cat_name.'</label></div>';
    }
    ?>
    </div>

I got a div with an error message like following

<div class="error_msg">Please Select Atleast one category</div>

I just want to show this div in "ng-show" if none selected and show form as invalid while submitting the form.

Any one please advice me

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.