I'm working on a set of webpages that contain a client-side Javascript based database of personal profiles. I need to be able to copy the data from one custom object to another, but can't find an efficient way to do this.
Setup:
I have created a custom array object "profile[x]" where 'x' is the person's ID. The profile has custom properties, for example:
profile[x].FirstName
profile[x].LastName
...etc, etc.
I need to be able to move all of the data from profile[x] to profile[y] where it can be editted without changing the data in profile[x]. I tried the logical solution:
profile[y] = profile[x]
However, this appears to create a permanent binding between the two instances of profile. So if I later do 'profile[y].FirstName = "Ed" ', profile[x].FirstName is ALSO changed to "Ed".
There is a rather large number of customer properties for profile, and I don't want to have to assign every single one of them individually. How can I copy all of the values from profile[x] to profile[y] without creating a permanent link between the two?
Thanks,
Joe
Setup:
I have created a custom array object "profile[x]" where 'x' is the person's ID. The profile has custom properties, for example:
profile[x].FirstName
profile[x].LastName
...etc, etc.
I need to be able to move all of the data from profile[x] to profile[y] where it can be editted without changing the data in profile[x]. I tried the logical solution:
profile[y] = profile[x]
However, this appears to create a permanent binding between the two instances of profile. So if I later do 'profile[y].FirstName = "Ed" ', profile[x].FirstName is ALSO changed to "Ed".
There is a rather large number of customer properties for profile, and I don't want to have to assign every single one of them individually. How can I copy all of the values from profile[x] to profile[y] without creating a permanent link between the two?
Thanks,
Joe