What I am trying to do is to populate my input fields based on JSON object. Below are the fields with their default values:

```
<input type="hidden" name="id"/>
<input id="enabled1" name="enabled" type="checkbox" value="true"> // not sure why value="true" here, by default it should be false

```

The JSON object has the following format:

```
[{enabled:false, id:184}]

```

Based on the JSON object, I will iterate its properties and assign the value to the field accordingly. The iterate function is as follows:

```
            for ( var propertyName in aData) {
                if (aData.hasOwnProperty(propertyName)){
                    // check if field exist
                    var elem = $("input[name="+propertyName+"]");
                    var exist = elem.size() == 1;
                    // if exist, update field with selected info
                    if (exist){
                        elem.val(aData[propertyName]);
                    }
                }
            }

```

After the iterate function runs the fields are shown like below:

```
<input type="hidden" name="id" value="184">
<input id="enabled1" name="enabled" type="checkbox" value="false">

```

Now if I tick the checkBox and submit the information to server, I want the value to be true but somehow the value is still false. What did I miss out here ?