i want to store form on clientside, in json in cookie, after that deserialize it back to form.
what i'm doing:

serialization to JSON: 

```
function formToJSON(selector) {
    var form = {};
    $(selector).find(':input[name]:enabled').each(function () {
        var self = $(this);
        var name = self.attr('name');

        if (name.indexOf('TextBox', 0) == 0) {
            if (form[name]) {
                form[name] = form[name] + ',' + self.val();
            }
            else {
                form[name] = self.val();
            }
        }
    });

    return form;
}

```

then on form change, i'm trying to save form to cookie:

```
 $('#form1 :input').change(function () {

    var eba = formToJSON($('#form1'));

    $.cookie.set('fo', eba, {json:true});
    var a = $.cookie.get('fo',true);
    alert(a);

    //$.cookie.set('form123', { "ksf": "saf", "tt": "" }, { json: true });
    //var b = $.cookie.get('form123', true);
    //alert(JSON.stringify(b));
});

```

in debugger - eba is json object, but alert(a) gives null.
commented code works, this json serialized, and i'm gettin it from cookies.
but why code doesnt work for form???
cookie plugin taken from jquery.com