PDA

View Full Version : Json parsing problem


nagrgk
06-02-2010, 12:19 PM
Hello guys,

Please suggest me to parse following string using json and javascript.

{ "form": { "name":"General GCH form", "fields":[ {"name":"field_id_2270", "label":"Your Full Name", "description":"Your first and last name", "type":"text field", "mandatory":"true", "attributes":["size":"40"]} , {"name":"field_id_2278", "label":"Number of places to reserve", "description":"How many are you registering for?", "type":"combo box", "mandatory":"true", "attributes":[]}
]}}

I am new to this language and looking for code since one week.

advanced thanks
nagaraja kharvi

Dormilich
06-02-2010, 02:17 PM
try JSON.parse() from json.org’s library.

rnd me
06-02-2010, 09:43 PM
you need to have valid json before you can parse it...