php - Parse Json string to Html elements -


i have json string : [{"row_id":"1","name":"amoghengineers","category":"dress","subcategory":"jeans","district":"7","location":"india","plan":"gold","productorservice":"product","email":"mymail@gmail.com","about":"goodone","phone":"98675433","registration_confirmed":"yes"}] .

and need parse these data html field elements ,for eg: want set name input field $("#businessname").val(name). how can ? in advance .

you can this,

live demo

$("#businessname").val(jsonobjarray[0].name) 

edit if have in string can use $.parsejson

jsonobjarray= $.parsejson('[{"row_id":"1","name":"amoghengineers","category":"dress","subcategory":"jeans","district":"7","location":"india","plan":"gold","productorservice":"product","email":"mymail@gmail.com","about":"goodone","phone":"98675433","registration_confirmed":"yes"}]');     $("#businessname").val(jsonobjarray[0].name); 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -