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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -