I want to build a HTML page that allows the user to construct an object that can then be posted as JSON to an internally hosted service (similar to the Chrome Advanced Rest Client). The user must be able to add and remove properties.

My model is not correct because each property is treated like an object with the properties 'name' and 'value'. I end up with an array of objects instead of an object with properties.

Here is a snippet of the HTML:

```
   <table>
        <thead>
            <tr>
                <th>Property Name</th>
                <th>Property Value</th>
                <th></th>
            </tr>            
        </thead>
        <tbody data-bind="foreach: myFieldList">
            <tr>
                <td><input data-bind="value: name" /></td>
                <td><input data-bind="value: value" /></td>
                <td><span class="removeVar" data-bind="click: removeProperty">Remove property</span></td>
            </tr>
        </tbody>
    </table>
    <p>
        <span id="addVar" data-bind="click: addProperty">Add Property</span>
    </p>
<textarea name="tasks" data-bind="value: ko.toJSON(myFieldList)"></textarea>

```

Here is the JS:

```
<script type="text/javascript">

    function dynamicProperty(name, value) {
        var self = this;
        this.name = name;
        this.value = value;
    }

    function fieldModel() {
        var self = this;           
//start with 2 empty properties
        self.myFieldList = ko.observableArray([
            new dynamicProperty("", ""),
            new dynamicProperty("","")
        ]);

        var noTracker = self.myFieldList.length;

        self.removeProperty = function (dynamicProperty) {
            self.myFieldList.remove(dynamicProperty);
        }

        self.addProperty = function () {
            noTracker++;
            self.myFieldList.push(new dynamicProperty(this.name,this.value));
        }
    }

    ko.applyBindings(fieldModel);

</script>

```

What I get in the textarea is output like this:

```
[{"name":"test name 1","value":"test value 1"},{"name":"test name 2","value":"test value 2"}]

```

What I want is output like this:

```
{"test name 1":"test value 1","test name 2":"test value 2"}

```

I fear this is rather trivial but in my defense I am very new to JS and Knockout, so any help you can offer would be hugely appreciated. Thanks.