Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a following json data

{"fields":[{"label":"First Name","field_type":"text","required":true,"field_options":{"size":"medium","description":"","minlength":"5","maxlength":"50","min_max_length_units":"characters"},"cid":"c6"}
,{"label":"Last Name","field_type":"text","required":true,"field_options":{"size":"medium","description":"","minlength":"1","maxlength":"50","min_max_length_units":"characters"},"cid":"c10"}
,{"label":"Gender","field_type":"radio","required":true,"field_options":{"options":[{"label":"Male","checked":true},{"label":"Female","checked":false}],"include_other_option":false},"cid":"c14"}
,{"label":"Class","field_type":"dropdown","required":true,"field_options":{"options":[{"label":"First","checked":false},{"label":"Second","checked":false},{"label":"Third","checked":false},{"label":"Fourth","checked":false}],"include_blank_option":false},"cid":"c18"}
,{"label":"Key Skills","field_type":"checkboxes","required":true,"field_options":{"options":[{"label":"Studies","checked":false},{"label":"Sports","checked":false},{"label":"Speaker","checked":false}]},"cid":"c24"}]}


How can I render it into the html ?
Posted
Comments
Sergey Alexandrovich Kryukov 27-Feb-15 0:38am    
You can generate it the way you want. How can we know what result do you expect? What do you mean "how"? What do you miss, exactly?
—SA
raju@shekhar 27-Feb-15 1:05am    
Sorry for the incomplete question. I want to generate html like this
Sergey Alexandrovich Kryukov 27-Feb-15 1:21am    
Why, why showing a bitmap? It does not show anything.
Not clear what your problem is. You have everything to generate a string; generate whatever you want...
—SA
Mohibur Rashid 27-Feb-15 3:27am    
Its very simple task. Why dont you start doing it? Start with JSON.parse. Look it up on google.

1 solution

Just parse the json and then do stuff. Very easy.

One example - Generate HTML tags using JSON and jQuery[^].
 
Share this answer
 
Comments
raju@shekhar 2-Mar-15 12:07pm    
Thanks Tadit, It leads me to the solution. I am definitely starting to work on it
Awesome. :) Keep coding.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900