Question: I want to click on a checkbox and if I click this box it should run a function what gets an ID and saves it into an array or deletes it from the array if it still exists in the array.

That works, but if I click on the text beside the box the function runs twice. It first writes the ID into the array and then deletes it.

I hope you can help me so that I can click on the text and it just runs once

**HTML**

```
<label><input type="checkbox" value="XXX" >Active</label>

```

**JavaScript/jQuery**

```
function addOrRemoveBoxes(ID){
    if(boxArr.indexOf(ID) != -1){
        removeFromArray(ID)
    }
    else{
        boxArr.push(ID);
    }
}

$(".checkBoxes").unbind().click(function() {
    event.stopPropagation();
    addOrRemoveBoxes($(this).find('input').val());
});

```

Answer: 
Looks like the AWS Node JS has a bug, in that we need not mention the data type for the keys.

I tried this and it worked well

```
{
"RequestItems":{
  "<TableName>":{
    "Keys":[
         {"<HashKeyName>":"<HashKeyValue1>", "<RangeKeyName>":"<RangeKeyValue2>"},
         {"<HashKeyName>":"<HashKeyValue2>", "<RangeKeyName>":"<RangeKeyValue2>"}
        ]
    }
  }
}

```
You get this error when the schema of your table does not match the key schema of the keys you provided. You provided a key with Hash=String and Range=String. What is the schema of your table? You can use the [DescribeTable](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html) API to get the schema of your table.