By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,846 Members | 1,281 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,846 IT Pros & Developers. It's quick & easy.

Creating an array of objects with variable properties

Claus Mygind
P: 571
I am getting a little hung up on the syntax I need to populate a hash table within an hash table of object. (not even sure if I stated that correctly)

Here is the structure I am trying to set up


There can only be one unique GroupName

There can be multiple "DeptName" and within "DeptName" there can be a
variable number of Codes. For example"

ShoreWoodJobs (GroupName)
2330 (DeptName)
30 (Code)

The process start when the user completes the form, one entry field (where they create the group name) and two
list boxes.

The second select box is set to multiple selects.

The first select box is not multiple but I intend for the user to be able to cycle
around and add a 2nd, 3rd.... DeptName each with their own code.

What I am trying to avoid is having a standard array elem[1], elem[2], ....

Ultimately, since this will be a data stored in a fairly small table, when the user calls up the form I wish to create this array structure for validation on the client side i.e verify that no duplicate group names are created or offer the user the choice that their current entry will replace the existing stored values.

Any suggested code would be appreciated.
Oct 28 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 16,027
You may find this useful. You could also look into JSON.
Oct 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.