1

Here is the link.

What I am trying to do is when Option1 is clicked, the Answer Object will show:
{"Untitle Title": Option1}, then if Option2 is click, it will add Option2 value.

Here my problem is, when Option1 or Option2 is clicked, the other is clicked as well. and the print object is: {"Untitle Title": true}, but what I want is {"Untitle Title": Option1}

Could someone help me on that? Thanks in advance!

Davin Tryon
  • 66,517
  • 15
  • 143
  • 132
Justin
  • 2,765
  • 6
  • 24
  • 25
  • possible duplicate of [Difficulty with ng-model, ng-repeat, and inputs](http://stackoverflow.com/questions/13714884/difficulty-with-ng-model-ng-repeat-and-inputs) – Felipe Sabino Mar 27 '14 at 13:06
  • I see that you are using `ng-model` inside a `ng-repeat`, you might want to check this out http://stackoverflow.com/questions/13714884/difficulty-with-ng-model-ng-repeat-and-inputs – Felipe Sabino Mar 27 '14 at 13:06
  • Each checkbox is bound to the same model value: ng-model="answer[data.Question.title[lang]]" (lang is constant) which would explain why clicking on one checkbox affects the other. As you're using checkboxes, the answer object with a key of the question title won't work as the keys need to be unique. – Gruff Bunny Mar 27 '14 at 13:45
  • @GruffBunny hmm... i think so, so what you recommend to do? change the object structure? – Justin Mar 27 '14 at 13:56

0 Answers0