jeudi 30 janvier 2020

how to get the values of multiple JSON arrays using checkboxes?if i select the multiple checkboxes once at a time,im geting 1st json value

html and js

<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" >
    <link href="https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap" rel="stylesheet">
    <title>Vendor Regestration</title>
</head>
<body>
<link href="https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap" rel="stylesheet">
<div class="container">
<!-- <button class="btn btn-default" onclick="getallcategory();">click</button> -->
    <ul class="nav nav-tabs" id="myTab" role="tablist">
  <li class="nav-item">
    <a class="nav-link active" id="phone-tab" data-toggle="tab" href="#phone" role="tab" aria-controls="phone" aria-selected="true">Phone Verification</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" id="info-tab" data-toggle="tab" href="#info" role="tab" aria-controls="info" aria-selected="false">Seller Information</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" id="tax-tab" data-toggle="tab" href="#tax" role="tab" aria-controls="tax" aria-selected="false">Tax details</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" id="seller-tab" data-toggle="tab" href="#seller" role="tab" aria-controls="seller" aria-selected="false">Select items to Sell</a>
  </li>
    <li class="nav-item">
    <a class="nav-link" id="interview-tab" data-toggle="tab" href="#interview" role="tab" aria-controls="interview" aria-selected="false">Interview</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" id="dashboard-tab" data-toggle="tab" href="#dashboard" role="tab" aria-controls="dashboard" aria-selected="false">Dashboard</a>
  </li>
</ul>
<div class="tab-content" id="myTabContent">
  <div class="tab-pane fade show active" id="phone" role="tabpanel" aria-labelledby="phone-tab">
        <div class="container">
                <h1 class="text-center"><span style="color:#eb34db">Verify Mobile Number</span></h1><br><br>
                <div class="form-group form-inline justify-content-center">
    <label for="mobno"><p class="text-dark">Enter the mobile number</label>
    <input type="text" class="form-control" id="mobno" aria-describedby="nm"style="width: 300px; height: 30px;">
     <button type="submit" class="btn btn-primary my-1">Send SMS</button>
    <small id="nm" class="form-text text-muted">We'll send a verification code to this number</small>
  </div>
        </div>  
  </div>
  <div class="tab-pane fade" id="info" role="tabpanel" aria-labelledby="info-tab">
        <div class="container">
            <h1 class="text-warning text-center">Tell us about your business</h1><br><br>
            <form justify-content-center>
  <div class="form-group">
    <label for="sname">Store Name</label>
    <input type="text" class="form-control" id="sname" style="width: 400px;">
  </div>
  <div class="form-group">
    <label for="pc">Select Product Category</label>
    <select class="form-control" id="pc" style="width: 400px;">
      <option selected>Choose Primary Category</option>
    </select>
    </div>
    <h4 class="text-secondary ">Enter your Address</h4>
  <div class="form-group">
    <label for="pc">Pincode</label>
    <input type="text" class="form-control" id="pc" style="width: 400px;">
  </div>
  <div class="form-group">
    <label for="ad1">Addrress Line 1(Required)</label>
    <input type="text" class="form-control" id="ad1" style="width: 400px;">
  </div>
  <div class="form-group">
    <label for="ad2">Address Line 2</label>
    <input type="text" class="form-control" id="ad2" style="width: 400px;">
  </div>
  <div class="form-group">
    <label for="ct">City</label>
    <input type="text" class="form-control" id="ct" style="width: 400px;">
  </div>
  <div class="form-group">
    <label for="st">Select Your State</label>
    <select class="form-control" id="st" style="width: 400px;">
      <option selected>Choose State</option>
    </select>
    </div>
    <div class="form-check">
  <input class="form-check-input" type="checkbox" value="" id="ac1">
  <label class="form-check-label" for="ac1">
    aabbaaaa Services
  </label>
</div><br>
<button type="button" class="btn btn-primary" style="width: 300px">Next</button>
</form>
        </div>
  </div>
  <div class="tab-pane fade" id="tax" role="tabpanel" aria-labelledby="tax-tab">
    <div class="container">
        <h3 class="text-dark"> Update Your Tax details</h3><br>
        <h5 class="text-gray-dark">Do You Have GST Number?</h5>
        <div class="form-check">
  <input class="form-check-input" type="radio" name="yes" id="yes" value="Yes">
  <label class="form-check-label" for="yes">
    Yes
  </label>
  <br>
    <input class="form-check-input" type="radio" name="no" id="no" value="no">
  <label class="form-check-label" for="no">
    No
  </label>
</div><br>
<button type="button"class="btn btn-outline-warning" style="width: 300px;">Continue</button>
    </div>
  </div>
  <div class="tab-pane fade" id="seller" role="tabpanel" aria-labelledby="seller-tab">
    <div class="container">
    <h3 class="text-dark"> Choose categories, You wish to sell</h3><br>
      <div class="form-group form-inline text-center">
    <label for="select_category">Select Category</label>&emsp;
<select class="custom-select" id="select_category" style="width: 500px;" onchange="listcatcb();">
    <option selected></option>
  </select>
  <!-- &emsp;<button class="btn btn-outline-success" onclick="listcatcb();">Submit</button> -->
    </div>
<div class="container" id="cats">
  <div class="form-check" id="catrbs">
  </div>
  <button class="btn btn-outline-secondary" onclick="nextcats();">Click Next!</button>
</div>
</div>
</div>

   <div class="tab-pane fade pt-4" id="interview" roll="tabpanel" aria-labelledby="interview-tab">
    <div class="container">
        <h5 class="text-gray-dark ">Where do You get Products from?</h5>
        <div class="row">
            <div class="col-lg-6 col-md-6 col-12">
                <div class="form-check">
  <input class="form-check-input" type="checkbox" value="iman" id="iman">
  <label class="form-check-label" for="iman">
    I manufacture them
  </label>      
            </div>
        </div>
        <div class="col-lg-6 col-md-6 col-12">
                <div class="form-check">
  <input class="form-check-input" type="checkbox" value="imans" id="imans">
  <label class="form-check-label" for="imans">
    I sell manufactured from me
  </label>      
            </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-6 col-md-6 col-12">
                <div class="form-check">
  <input class="form-check-input" type="checkbox" value="ires" id="ires">
  <label class="form-check-label" for="ires">
    I resell product that I buy
  </label>      
            </div>
            </div>
            <div class="col-lg-6 col-md-6 col-12">
                <div class="form-check">
  <input class="form-check-input" type="checkbox" value="imprt" id="imprt">
  <label class="form-check-label" for="imprt">
    I import them
  </label>      
            </div>
            </div>
        </div>
    <br><br>
    <div class="row">
      <div class="col-lg-6 col-md-6 col-12">
        <div class="form-group">
    <label for="atn">What is your annual turnover?</label>
    <select class="form-control" id="atn" style="width: 400px;">
      <option selected>Select an option</option>
    </select>
  </div>
      </div>
      <div class="col-lg-6 col-md-6 col-12">
                <div class="form-group">
    <label for="nop">How many products do you sell?</label>
    <select class="form-control" id="nop" style="width: 400px;">
      <option selected>Select an option</option>
    </select>
  </div>
      </div>
    </div>
    <div>
      <h5 class="text-gray-dark ">Do You sell in other websites?</h5>
    <div class="row">
  <div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="y" id="y" value="y">
  <label class="form-check-label" for="y">Yes</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="n" id="n" value="n">
  <label class="form-check-label" for="n">No</label>
</div>
    </div>
  </div>
    </div>
   </div>
  <div class="tab-pane fade" id="dashboard" role="tabpanel" aria-labelledby="dashboard-tab">
    <div class="container">
        <h5 class="text-gray-dark pt-4">You're almost there to become a vendor with aabbaaaa</h5>
            <div class="jumbotron">
                <h3 class="text-gray-dark">1. Create Your aabbaaaa listings</h3>
                <p style="text-indent: 2em;">List the Products You wish to sell on aabbaa</p>
                <p class="text-dark"><b>Start selling in these categories:</b><br>Kitchen, Home, Consumer Electronics, Office Products</p>
                <div class="text-right">
                <button class="btn btn-outline-dark" id="startlisting">Start Listing</button>
            </div>
                <a href="#" style="text-decoration: none;">Edit Categories</a>

            </div>
            <div class="jumbotron">
               <div class="dropdown">
                <h3 class="text-gray-dark dropdown-toggle btn" id="sr" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="text-decoration: none;">2. Set Shipping rates</h3>
                <div class="dropdown-menu" aria-labelledby="sr">
                </div>
            </div>
                <p style="text-indent: 2em;">Set the shopping rate of the product for buyers</p>
                <div class="text-right">
                <button class="btn btn-light">Set rates</button>
            </div>
            <p class="text-gray">Set Your shipping rates</p>
            </div>
            <div class="jumbotron">
                <h3 class="text-gray-dark">3. Enter Bank details</h3>
                <form class="form-inline">
                     <label for="bn">Enter Name</label>
                         <input type="text" class="form-control" id="bn" placeholder="Name as on bank documents" style="width: 225px;">
                         <label for="selacc">Which type account you have</label>
                        <select class="custom-select my-1 mr-sm-2" id="selacc" >
                            <option selected>--Select your account type--</option>
                    </select>
                </form>
                <form class="form-inline">
                     <label for="acn">Account Number</label>
                    <input type="text" class="form-control" id="acn" placeholder="Upto 34 Charecters" style="width: 225px;">
                     <label for="racn"> Re-enter Account Number</label>
                    <input type="text" class="form-control" id="racn"  style="width: 225px;">

                </form><br>
                <label for="ifc">IFSC code</label>
                    <input type="text" class="form-control" id="ifc" placeholder="Example ABCD0123456" style="width: 225px;">

                <div class="text-right">
                    <button class="btn btn-light">Save</button> 
                </div>
            </div>
            <div class="jumbotron">
                <h3 class="text-gray-dark">4. Enter Tax details</h3>
                    <p style="text-indent: 2em;">Update Your tax Details</p>
                    <form class="form-inline">
                     <label for="pan">PAN Number</label>
                    <input type="text" class="form-control" id="pan"  style="width: 225px;">
                     <label for="gstn"> Provisional GSTIN</label>
                    <input type="gstn" class="form-control" id="gstn"  style="width: 225px;">

                </form>
                <div class="text-right">
                    <button class="btn btn-light">Save</button> 
                </div>
            </div>
            <div class="jumbotron">
                <h3 class="text-gray-dark">5. Product Tax Code</h3>
                <p style="text-indent: 2em;">PTC (Product Tax Code) are codes which are mapped to GST rates notified by the Govt.</p>

                <div class="form-group" style="position: relative;">
    <label for="pt"><p class="text-dark"><b>Default PTC</b></p></label>
    <input type="text" class="form-control" id="pt" style="width: 400px;">
  </div>
                <div class="form-group form-check">
    <input type="checkbox" class="form-check-input" id="aptc">
    <label class="form-check-label" for="aptc">I've reviewed to agree Aabbaaaa's <a href="#" style="text-decoration: none;">Tax Calculation Methodology</a></label>
  </div>
  <button class="btn btn-light">Save</button>
  <p><a href="#" style="text-decoration: none;">View all Product Tax Codes</a><br><a href="#" style="text-decoration: none;">Learn more about PTC</a></p>

            </div>
            <div class="jumbotron">
                <h3 class="text-gray-dark">6. Digital Image Signature</h3>
                <p style="text-indent: 2em;">Upload a scan copy of your signature which will be used on the invoices sent to customers.</p>
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-12">
                        <label for="sin">Upload Your Signature</label>
                    <input type="file" class="form-control" id="sin"  style="width: 225px;">
                    </div>
                    <div class="col-lg-6 col-md-6 col-12">
                        <h5 class="text-gray-dark"><b>What to upload?</b></h5>
                        <ul>
                            <li style="style="text-indent: 2em;>Sign on a whhite Paper, scan the signature and upload the image</li>
                            <li style="style="text-indent: 2em;>Signature should be legible and in focus</li>
                            <li style="style="text-indent: 2em;>Only upload JPEG or JPG image format</li>
                            <li style="style="text-indent: 2em;>Image size should not exceed 2mb</li>
                        </ul>       
                    </div>
                </div>
            </div>
            <div class="text-center">
                <button class="btn btn-warning">Launch Your Business</button>
            </div>
    </div>
  </div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
    <script>

   var selcat;
    document.getElementById("startlisting").onclick = function () {
        location.href = "plf.html";
    }
 getallcategory();
      function getallcategory()
{
var link='allcat.json';
$.post(link).done(function(data)
{
data2=JSON.stringify(data);
var obj=jQuery.parseJSON(data2);
for (var i = 0; i < obj.length; i++) 
{
  $("#select_category").append('<option value="' +obj[i].name+'">' +obj[i].name+ '</option> ')
}
});
}

function listcatcb()
{
   selcat=document.getElementById("select_category").value;
  var link='allcat.json';
$.post(link).done(function(data)
{
data2=JSON.stringify(data);
var obj=jQuery.parseJSON(data2);
for (var i = 0; i < obj.length; i++) 
{
  if (obj[i].name==selcat) 
  {
for (var j = 0; j < obj.length; j++) 
{
    // console.log(obj[i].siblings[j].name);
  $("#catrbs").append('<input class="form-check-input catcbs" type="checkbox" id="'+obj[i].siblings[j].name+'" value="'+obj[i].siblings[j].name+'"><label class="form-check-label" for="'+obj[i].siblings[j].name+'">'
    +obj[i].siblings[j].name+
  '</label><br/>')   
 }   
 } 
}

}); 
}

function nextcats()
{
  var link='allcat.json';


  // $(function(){
  //     var val = [];
  //       $('.catcbs:checked').each(function(i){
  //         val[i] = $(this).val();
  //     console.log(val[i]);
  //       });
  //     });
var checkedValue =  $('.catcbs:checked').val();;
  // console.log(checkedValue);
 $.post(link).done(function(data)
{
data2=JSON.stringify(data);
var obj=jQuery.parseJSON(data2);

for (var i = 0; i < obj.length; i++) 
{
  if (obj[i].name==selcat) 
  {
for (var j = 0; j < obj.length; j++) 
{

  if (obj[i].siblings[j].name==checkedValue) 
  {
 for (var k = 0; k < obj.length; k++) 
{
    console.log(obj[i].siblings[j].siblings[k].name);
  // $("#catrbs").append('<input class="form-check-input catcbs" type="checkbox" id="'+obj[i].siblings[j].siblings[k].name+'" value="'+obj[i].siblings[j].siblings[k].name+'"><label class="form-check-label" for="'+obj[i].siblings[j].siblings[k].name+'">'
  //   +obj[i].siblings[j].siblings[k].name+
  // '</label><br/>')   
 }   
 } 
}
}
}
});  
  }

$(document).ready(function () {
      $.ajax({
   url:"jsoncategory.txt",
   method:"POST",
   success:function(data)
   {
var cat=data;
var ks=[];
ks = cat.split("\n");
for(i=0;i<ks.length;i++)
{
$("#pc").append('<option value="' +ks[i]+'">' +ks[i]+ '</option> ')
}
},
   error:function(data){
          console.log(data);
        }
  })
      })
       </script>
</body>
</html>

JSON

[{
    "id": "47",
    "name": "Women",
    "parent": "0",
    "status": "Enabled",
    "itemcount": 44,
    "siblings": [{
        "id": "87",
        "name": "Personal Care Appliances",
        "parent": "47",
        "status": "Enabled",
        "itemcount": 2,
        "siblings": [{
            "id": "88",
            "name": "Hair Dryers",
            "parent": "87",
            "status": "Enabled",
            "itemcount": 2,
            "siblings": []
        }]
    }, {
        "id": "127",
        "name": "Jewellary",
        "parent": "47",
        "status": "Enabled",
        "itemcount": 41,
        "siblings": [{
            "id": "128",
            "name": "Artificial Jewellary",
            "parent": "127",
            "status": "Enabled",
            "itemcount": 41,
            "siblings": []
        }]
    }]
}, {
    "id": "51",
    "name": "Home furniture",
    "parent": "0",
    "status": "Enabled",
    "itemcount": 380,
    "siblings": [{
        "id": "59",
        "name": "Furniture",
        "parent": "51",
        "status": "Enabled",
        "itemcount": 119,
        "siblings": [{
            "id": "93",
            "name": "Chairs",
            "parent": "59",
            "status": "Enabled",
            "itemcount": 14,
            "siblings": []
        }, {
            "id": "94",
            "name": "Swing",
            "parent": "59",
            "status": "Enabled",
            "itemcount": 9,
            "siblings": []
        }, {
            "id": "109",
            "name": "Beds",
            "parent": "59",
            "status": "Enabled",
            "itemcount": 36,
            "siblings": []
        }, {
            "id": "110",
            "name": "Tables",
            "parent": "59",
            "status": "Enabled",
            "itemcount": 7,
            "siblings": []
        }, {
            "id": "111",
            "name": "Wadrobes",
            "parent": "59",
            "status": "Enabled",
            "itemcount": 44,
            "siblings": []
        }, {
            "id": "112",
            "name": "TV Units & Cabinets",
            "parent": "59",
            "status": "Enabled",
            "itemcount": 7,
            "siblings": []
        }]
    }, {
        "id": "70",
        "name": "Home Decor",
        "parent": "51",
        "status": "Enabled",
        "itemcount": 245,
        "siblings": [{
            "id": "71",
            "name": "Wall Clock",
            "parent": "70",
            "status": "Enabled",
            "itemcount": 245,
            "siblings": []
        }]
    }, {
        "id": "91",
        "name": "Home Lighting",
        "parent": "51",
        "status": "Enabled",
        "itemcount": 5,
        "siblings": [{
            "id": "92",
            "name": "Emergency Lights",
            "parent": "91",
            "status": "Enabled",
            "itemcount": 5,
            "siblings": []
        }]
    }, {
        "id": "123",
        "name": "Kitchen Storage",
        "parent": "51",
        "status": "Enabled",
        "itemcount": 13,
        "siblings": [{
            "id": "124",
            "name": "Water Bottles",
            "parent": "123",
            "status": "Enabled",
            "itemcount": 13,
            "siblings": []
        }]
    }]
}, {
    "id": "57",
    "name": "TVs & Appliances",
    "parent": "0",
    "status": "Enabled",
    "itemcount": 150,
    "siblings": [{
        "id": "58",
        "name": "Television",
        "parent": "57",
        "status": "Enabled",
        "itemcount": 10,
        "siblings": [{
            "id": "72",
            "name": "HD Ready TV",
            "parent": "58",
            "status": "Enabled",
            "itemcount": 1,
            "siblings": []
        }, {
            "id": "73",
            "name": "Full HD TV",
            "parent": "58",
            "status": "Enabled",
            "itemcount": 2,
            "siblings": []
        }, {
            "id": "74",
            "name": "Android TV",
            "parent": "58",
            "status": "Enabled",
            "itemcount": 0,
            "siblings": []
        }, {
            "id": "75",
            "name": "Smart TV",
            "parent": "58",
            "status": "Enabled",
            "itemcount": 2,
            "siblings": []
        }, {
            "id": "76",
            "name": "Smart 4K Ultra HD TV",
            "parent": "58",
            "status": "Enabled",
            "itemcount": 5,
            "siblings": []
        }]
    }, {
        "id": "68",
        "name": "Refrigerators",
        "parent": "57",
        "status": "Enabled",
        "itemcount": 55,
        "siblings": [{
            "id": "69",
            "name": "Double Door",
            "parent": "68",
            "status": "Enabled",
            "itemcount": 23,
            "siblings": []
        }, {
            "id": "77",
            "name": "Single Door",
            "parent": "68",
            "status": "Enabled",
            "itemcount": 24,
            "siblings": []
        }, {
            "id": "104",
            "name": "Deep Freezer",
            "parent": "68",
            "status": "Enabled",
            "itemcount": 8,
            "siblings": []
        }]
    }, {
        "id": "78",
        "name": "Kitchen Appliances",
        "parent": "57",
        "status": "Enabled",
        "itemcount": 14,
        "siblings": [{
            "id": "79",
            "name": "Microwave Oven",
            "parent": "78",
            "status": "Enabled",
            "itemcount": 6,
            "siblings": []
        }, {
            "id": "82",
            "name": "Oven Toaster Griller",
            "parent": "78",
            "status": "Enabled",
            "itemcount": 2,
            "siblings": []
        }, {
            "id": "83",
            "name": "Electric Kettle",
            "parent": "78",
            "status": "Enabled",
            "itemcount": 3,
            "siblings": []
        }, {
            "id": "84",
            "name": "Hand Blender",
            "parent": "78",
            "status": "Enabled",
            "itemcount": 4,
            "siblings": []
        }, {
            "id": "85",
            "name": "Sandwich Maker",
            "parent": "78",
            "status": "Enabled",
            "itemcount": 1,
            "siblings": []
        }, {
            "id": "86",
            "name": "Pop Up Toaster",
            "parent": "78",
            "status": "Enabled",
            "itemcount": 1,
            "siblings": []
        }]
    }, {
        "id": "80",
        "name": "Small Home Appliances",
        "parent": "57",
        "status": "Enabled",
        "itemcount": 38,
        "siblings": [{
            "id": "81",
            "name": "Fans",
            "parent": "80",
            "status": "Enabled",
            "itemcount": 17,
            "siblings": []
        }, {
            "id": "89",
            "name": "Iron",
            "parent": "80",
            "status": "Enabled",
            "itemcount": 5,
            "siblings": []
        }, {
            "id": "90",
            "name": "Room Heaters",
            "parent": "80",
            "status": "Enabled",
            "itemcount": 3,
            "siblings": []
        }, {
            "id": "125",
            "name": "Landline Phones",
            "parent": "80",
            "status": "Enabled",
            "itemcount": 10,
            "siblings": []
        }]
    }, {
        "id": "101",
        "name": "Washing Machine ",
        "parent": "57",
        "status": "Enabled",
        "itemcount": 33,
        "siblings": [{
            "id": "102",
            "name": "Fully Automatic Front Load",
            "parent": "101",
            "status": "Enabled",
            "itemcount": 5,
            "siblings": []
        }, {
            "id": "103",
            "name": "Fully Automatic Top Load",
            "parent": "101",
            "status": "Enabled",
            "itemcount": 14,
            "siblings": []
        }, {
            "id": "122",
            "name": "Semi Automatic Top Load",
            "parent": "101",
            "status": "Enabled",
            "itemcount": 14,
            "siblings": []
        }]
    }]
}, {
    "id": "95",
    "name": "Sports,Books & More",
    "parent": "0",
    "status": "Enabled",
    "itemcount": 50,
    "siblings": [{
        "id": "96",
        "name": "Stationary",
        "parent": "95",
        "status": "Enabled",
        "itemcount": 17,
        "siblings": [{
            "id": "97",
            "name": "Calculators",
            "parent": "96",
            "status": "Enabled",
            "itemcount": 17,
            "siblings": []
        }]
    }, {
        "id": "113",
        "name": "Car,bike Accessories",
        "parent": "95",
        "status": "Enabled",
        "itemcount": 33,
        "siblings": [{
            "id": "116",
            "name": "Helmets & Riding Gears",
            "parent": "113",
            "status": "Enabled",
            "itemcount": 33,
            "siblings": []
        }]
    }]
}, {
    "id": "98",
    "name": "Electronics",
    "parent": "0",
    "status": "Enabled",
    "itemcount": 65,
    "siblings": [{
        "id": "99",
        "name": "Computer Peripherals",
        "parent": "98",
        "status": "Enabled",
        "itemcount": 11,
        "siblings": [{
            "id": "100",
            "name": "Printers & Ink Cartridges",
            "parent": "99",
            "status": "Enabled",
            "itemcount": 11,
            "siblings": []
        }]
    }, {
        "id": "105",
        "name": "Gaming & Accessories",
        "parent": "98",
        "status": "Enabled",
        "itemcount": 37,
        "siblings": []
    }, {
        "id": "106",
        "name": "Laptops",
        "parent": "98",
        "status": "Enabled",
        "itemcount": 48,
        "siblings": [{
            "id": "107",
            "name": "Gaming Laptops",
            "parent": "106",
            "status": "Enabled",
            "itemcount": 48,
            "siblings": []
        }]
    }]
}, {
    "id": "117",
    "name": "Men",
    "parent": "0",
    "status": "Enabled",
    "itemcount": 6,
    "siblings": [{
        "id": "118",
        "name": "Footwear",
        "parent": "117",
        "status": "Enabled",
        "itemcount": 6,
        "siblings": [{
            "id": "119",
            "name": "Sports Shoes",
            "parent": "118",
            "status": "Enabled",
            "itemcount": 3,
            "siblings": []
        }, {
            "id": "120",
            "name": "Sandals & Floaters",
            "parent": "118",
            "status": "Enabled",
            "itemcount": 2,
            "siblings": []
        }, {
            "id": "121",
            "name": "Casual Shoes",
            "parent": "118",
            "status": "Enabled",
            "itemcount": 1,
            "siblings": []
        }]
    }]
}]

here in this code if i select the 2 checkbox once at a time means i'm getting output of only first JSON value... if i uncheck one means im getting its respective values... i mean for example if i select women from category then im getting 2 checkboxes as 1.personal care appliances and 2.jewellery. if i select multiple checkboxes once at the time means im getting only hair dryers(the value within personal care appliances) but im not getting artificial jewellery(value within jewellery) if i select single at a time means im getting appropriate result please help me out with this error... ive stucked here i beg you... along with that im getting

Uncaught TypeError: Cannot read property 'name' of undefined at Object <anonymous> (regpage.html:345)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at y (jquery.min.js:4)
    at XMLHttpRequest.c (jquery.min.js:4)" this errror too... but it seems that it is not a major problem



Aucun commentaire:

Enregistrer un commentaire