[jQuery] Populate form with deserialize and JSON
I am attempting to auto-populate a form with a JSON response using the
deserialize plugin. It works for first level elements in the response.
But I can't figure out how to auto-set form elements that are arrays.
As an example here is the JSON response I am trying to bind:
{"FirstName":"Sean","MiddleInitial":"A","LastName":"Chambers","Email":"chambersa@nowhere.com","Address":
{"State":{"Id":10,"Abbrev":"FL","Name":"Florida"},"Street":"1 Nowhere
Drive","City":"Palm Coast","ZipCode":32164},"Discount":
{"SchoolEmployee":false,"Volunteer":false,"Handicapped":false,"FeeWaived":false,"PoolMember":false,"SecondChild":false},"HomePhone":
{"AreaCode":386,"Exchange":555,"Number":
1234},"WorkPhone":null,"CellPhone":null,"Age":27}
items like FirstName and LastName work fine. The problem is with the
Address:{} and State{} elements.
Is there any easy way to do this?
Thanks
Sean