0

Hey I am trying to set check-box image for input type="checkbox" with ng-repeat. I did the styling part everything is fine but when i set ng-repeat it is working for only first list here it is my css file

input[type=checkbox] {
    display:none;
}

  input[type=checkbox] + label {
  padding-left: 23px; height:21px;
background: url(/Content/images/check1-off.png) no-repeat;
font-family: Arial, Helvetica, sans-serif;
font-size:16px; font-weight:600;
color:#ffffff;
text-decoration:none;
margin-bottom: 0px;
display: inline;
}

  input[type=checkbox]:checked + label{
     padding-left: 23px; height:21px;
background: url(/Content/images/check1-on.png) no-repeat;
font-family: Arial, Helvetica, sans-serif;
font-size:16px; font-weight:600;
color:#ffffff;
text-decoration:none;
  margin-bottom: 0px;   
   display: inline;
}

basically im trying with this example but it is also not working for ng-repeat and im retrieving the values from database. Can any one one help me in this I am struck with this issue. Images are enter image description here enter image description here

2
  • it will be helpful if you can post the js code the problem might be lying there Commented Mar 18, 2014 at 8:21
  • i haven't written anything in js code the value is retrieving if i didnt apply any class to label for check box Commented Mar 18, 2014 at 8:26

1 Answer 1

1

Can you post your htmlcode? I would guess the problem is lying in your id value... It has to be unique. So i.e. id="radiobutton1" should be id="radibutton{{$index}}". But post your htmlcode and ill give a better answer.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.