Avatar

Level 10

Hi Elaine,

I've tried something like this before but a form variable can only hold a string value.  However you could acheive what I think you want using the toSource() method and eval function.

var co1 = { name : "customer name",
            address : "customer address",
            city : "customer city",
            state : "customer state",
            accounts : [1,2,3]
          };

CustomerObject.value = co1.toSource();

var co2 = eval(CustomerObject.value)

console.println(co2.name);
console.println(co2.address);
console.println(co2.city);
console.println(co2.state);
console.println(co2.accounts);

Though have you tried storing the object in a script object at a higher level in the form structure available to subforms.

Bruce