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 7965025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:02:59+00:00 2026-06-04T06:02:59+00:00

I want to create this JSON based on html elements { AppName: ERP, ModuleDesc:

  • 0

I want to create this JSON based on html elements

   {
  "AppName": "ERP",
  "ModuleDesc": [
    {
      "Name": "Payroll",
      "AcCESSRIGHTS": [
        {
          "Create": "Y",
          "Retrive": "Y",
          "Update": "Y",
          "Delete": "Y"
        }
      ]
    },
    {
      "Name": "Reports",
      "AcCESSRIGHTS": [
        {
          "Create": "Y",
          "Retrive": "N",
          "Update": "Y",
          "Delete": "N"
        }
      ]
    },
    {
      "Name": "Forms",
      "AcCESSRIGHTS": [
        {
          "Create": "Y",
          "Retrive": "Y",
          "Update": "N",
          "Delete": "N"
        }
      ]
    }
  ]
}

My HTML is :=

     <table>
        <tr>
            <td style="width: 200px;">APPLICATION CATEGORY :</td>
            <td>
                <input id="Text1" maxlength="35" name="ONEICAPP" style="width: 400px; text-transform: uppercase"
                    type="text" value="INTERIOR SYSTEM" />
            </td>
        </tr>
    </table>
    <table>
        <tr>
            <td style="width: 400px;"> MODULE DESCRIPTION</td>
            <td style="width: 50px;"> CREATE</td>
            <td style="width: 50px;"> RETRIVE</td>
            <td style="width: 50px;"> UPDATE</td>
            <td style="width: 50px;"> DELETE</td>
        </tr>
        </table>
<div id="ModuleDescriptions">
    <table >
        <tr>
           <td style="width: 400px;">
             <input id="ModuleName1" maxlength="35" style="width: 400px; text-transform: uppercase" type="text" value="ALL REPORTS" />
           </td><td>
           <table ><tr>
                 <td style="width: 50px;"><input id="CRT-1" type="checkbox" name="ModuleName1" value="C" />
            </td>
            <td style="width: 50px;"><input id="RTV-1" type="checkbox" name="ModuleName1" value="R"/>
            </td>
            <td style="width: 50px;"><input id="UPD-1" type="checkbox" name="ModuleName1" value="U" />
            </td>
            <td style="width: 50px;"><input id="DLT-1" type="checkbox" name="ModuleName1" value="D" />
            </td></tr></table></td>
        </tr>
        <tr>
           <td style="width: 400px;">
             <input id="ModuleName2" maxlength="35" style="width: 400px; text-transform: uppercase" type="text" value="CREATE MASTER" />
           </td><td><table><tr><td style="width: 50px;"><input id="CRT-2" class="Rights" type="checkbox" name="ModuleName2" value="C" />
            </td>
            <td style="width: 50px;"><input id="RTV-2" class="Rights" type="checkbox" name="ModuleName2" value="R"/>
            </td>
            <td style="width: 50px;"><input id="UPD-2" class="Rights" type="checkbox" name="ModuleName2" value="U" />
            </td>
            <td style="width: 50px;"><input id="DLT-2" class="Rights" type="checkbox" name="ModuleName2" value="D" />
            </td> </tr></table></td>
        </tr>
        <tr>
           <td style="width: 400px;">
             <input id="ModuleName3" maxlength="35" style="width: 400px; text-transform: uppercase" type="text" value="PROCESS" />
           </td><td><table><tr><td style="width: 50px;"><input id="CRT-3" class="Rights" type="checkbox" name="ModuleName3" value="C" />
            </td>
            <td style="width: 50px;"><input id="RTV-3" class="Rights" type="checkbox" name="ModuleName3" value="R"/>
            </td>
            <td style="width: 50px;"><input id="UPD-3" class="Rights" type="checkbox" name="ModuleName3" value="U" />
            </td>
            <td style="width: 50px;"><input id="DLT-3" class="Rights" type="checkbox" name="ModuleName3" value="D" />
            </td>
         </tr></table></td>
        </tr>
    </table>

Input IDs and corresponding Access rights (Check Boxes) name are same
can I use Jquery .each to loop and dynamically bulid json string? or any other way .. please help me

  • 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-06-04T06:03:00+00:00Added an answer on June 4, 2026 at 6:03 am

    after alot of googling I did it below way, may be it will help some one

                       data = "{'REQTYPE':'" + Req_Type + "', 'APPNAME':'" + $('[id$=hfONEICAPPLabel]').val() + "', "
            + "'MODULEDESC': [";
    
                    $('input[id*=ModuleName]').each(function () {
                        j++;
                        CompareName = $(this).attr('id');
                        data = data + "{'Name':'" + $(this).val() + "', "
            + "'ACCESSRIGHTS': [{";
                        $("input[name='" + CompareName + "']").each(function () {
                            if ($(this).is(':checked')) {
                                if ($(this).attr('id').substring(0, 3) === "CRT") {
                                    data = data + "'Create':'Y',";
                                }
                                else if ($(this).attr('id').substring(0, 3) === "RTV") {
                                    data = data + "'Retrive':'Y',";
                                }
                                else if ($(this).attr('id').substring(0, 3) === "UPD") {
                                    data = data + "'Update':'Y',";
                                }
                                else if ($(this).attr('id').substring(0, 3) === "DLT") {
                                    data = data + "'Delete':'Y'";
                                }
                            }
                            else {
                                if ($(this).attr('id').substring(0, 3) === "CRT") {
                                    data = data + "'Create':'N',";
                                }
                                else if ($(this).attr('id').substring(0, 3) === "RTV") {
                                    data = data + "'Retrive':'N',";
                                }
                                else if ($(this).attr('id').substring(0, 3) === "UPD") {
                                    data = data + "'Update':'N',";
                                }
                                else if ($(this).attr('id').substring(0, 3) === "DLT") {
                                    data = data + "'Delete':'N'";
                                }
                            }
                        });
                        if (i == j)
                            data = data + "}]}";
                        else
                            data = data + "}]},";
                    });
                    data = data + "]}";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to parse this Json code : [{id:7,key:integrationContinue:integrationContinue,name:life Portlet,scope:PRJ,qualifier:TRK,date:2012-03-26T10:10:22+0100,lname:life Portlet,lang:java,version:1.0-SNAPSHOT,description:,msr:[{key:ncloc,val:897.0,frmt_val:897},{key:coverage,val:0.6,frmt_val:0,6%}]}] I created two
I want to create a multidimensional json object based on a c# class. I
I want to create this parameter file so that I can send it to
I want to create this table in Oracle. This is only the table SQL
I want to create this JSF table with paging and sorting. This is JSF
I have a JasperReport and I want to create for this report a cover
I want to do something like this create type Item as object ( id
I want to create a link like this: <a href=http://example.com>text</a> and replace the behavior
I want to create an application like this: http://collabedit.com/ What is the most efficient
this table i want to create job_id dynamic Jobs Title text Job Description text

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.