Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6321223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:06:47+00:00 2026-05-24T16:06:47+00:00

I have the following JSON schema { employee: {display_name:EMPLOYEE NAME:, format:string, type:textbox, dflt:null, isMandatory:true}

  • 0

I have the following JSON schema

{
"employee":
             {"display_name":"EMPLOYEE NAME:",
              "format":"string",
              "type":"textbox",
              "dflt":"null",
              "isMandatory":"true"}
}

Now I have to generate an html tag i.e

<input type="text" value="name"></input>

How do I use the JSON with jQuery? I know I have to use append method. But I’m not sure how to append JSON elements.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:06:48+00:00Added an answer on May 24, 2026 at 4:06 pm

    You can use $.parseJSON to parse your text into a JSON object. Then use jQuery to create any elements you want and append it where you want. (Here’s a JSFiddle)

     var myJSON = '{ "employee": { "display_name":"EMPLOYEE NAME:", "format":"string", "type":"textbox", "dflt":"null", "isMandatory":"true" } }';
    
     var employee = $.parseJSON(myJSON).employee; //get employee object
     if (employee.type == "textbox") {
       $('<label>').attr({for: 'employee_name'}).text(employee.display_name).appendTo($('body'));
       $('<input>').attr({type: 'text', id:'employee_name'}).appendTo($('body'));
     }
    

    This generates the HTML:

     <label for="employee_name">EMPLOYEE NAME:</label>
     <input type="text" id="employee_name">
    

    I’m sure this is not exactly what you want, but this should definitely lead you in the right direction to solving your problem. Enjoy!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have follwing JSON: {mykey:[{name:Jak,interests:movies}]} and following opensocial app code: <script type=text/os-template require=mykey> <ul>
I have the following json output when i call a sample webservice <string>[{Name:Ajay Singh,Company:Birlasoft
I have the following Json : {\doc\:{\info\:{\allowDistribution\:\true\,\allowSearch\:\true\,\calaisRequestID\:\67a02f61-7e45-cfc4-1276-e123c5f7422f\,\externalID\:\\,\id\:\ http://id.opencalais.com/dBo1YRiQeqS-kfO-m9UeWA \,\docId\:\ http://d.opencalais.com/dochash-1/8edabb36-eece-3f67-b187-ab64cd885ecb \,\document\:\What type of music
I have a configuration file in the following JSON format: { key1: value1, key2:
I have the following javascript: $.ajax({ type: "POST", dataType: "json", url: "/Home/Submit", data: {
I have an json output of the following (ignore the escape characters) {\sEcho\:1,\iTotalRecords\:10,\iTotalDisplayRecords\:10,\aaData\:[{\Job\:\developer\,\Name\:\kurt\},{\Job\:\plumber\,\Name\:\john\}]} which
I have a MySQL database called People which contains the following schema <id,name,foodchoice1,foodchoice2> .
i have following json format { status: ACTIVE, result: false, isworking: false, margin: 1,
I have the following JSON file as input, { $type: NanoWebInterpreter.WebInputData, NanoWebInterpreter, NBBList: {
I have following json file. { id: 100001740605903, name: Mike Watshan, first_name: Mike, last_name:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.