angularjs自定义复选框按钮

时间:2013-12-11 01:57:33

标签: css angularjs twitter-bootstrap angularjs-directive angularjs-ng-repeat

您好我正在尝试在angularjs应用程序中创建一个自定义样式的复选框。每次用户选中或取消选中该复选框时,它都会向服务器发送一个呼叫。但是,有时当我检查或取消选中它时,它会通过$ HTPP服务向服务器发送null。可能是什么问题?

当我使用普通的复选框(没有样式)时,BTW完美无缺。

checkbox.html

        <!-- Custom checkbox portion of the html page -->
        <div class="criteria-two-col" ng-repeat="value in searchcriterias.gender">
             <div data-ng-click="newsearch('gender')">
             <input type='checkbox' class="styled-checkbox" id="gender{{value}}" value="    
         {{value}}" check-list='checked_gender'/>
             <label for="gender{{value}}"><span></span>{{value}}</label>
            </div>
         </div>

的style.css

   /*Custom checkbox styling*/

 input[type="checkbox"].styled-checkbox {
   display: none;
     }

  input[type="checkbox"] + label {
  color:#000;
   font-weight:300;
  }

input[type="checkbox"] + label span {
display:inline-block;
width:19px;
height:19px;
margin:-1px 4px 0 0;
vertical-align:middle;
background:url(../../../images/check_radio_sheet.png) left top no-repeat;
cursor:pointer;
}

input[type="checkbox"]:checked + label span {
background:url(../../../images/check_radio_sheet.png) -19px top no-repeat;
}

0 个答案:

没有答案