title: Passing checkbox values of a form as JSON?
body: <p>Html code :</p>
  
  <pre><code>   &lt;form class="form-horizontal" id="addpersons" style="padding:20px;"&gt;
  &lt;fieldset class="scheduler-border"&gt;
  
  &lt;!-- Form Name --&gt;
  &lt;legend class="scheduler-border"&gt;Information&lt;/legend&gt;
  
  &lt;!-- Text input--&gt;
  &lt;div class="form-group"&gt;
    &lt;label class="col-md-4 control-label" for="fname"&gt;First Name&lt;/label&gt;  
    &lt;div class="col-md-5"&gt;
    &lt;input id="fname" name="firstName" type="text" placeholder="First Name" class="form-control input-md"&gt;
  
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;!-- Text input--&gt;
  &lt;div class="form-group"&gt;
    &lt;label class="col-md-4 control-label" for="lname"&gt;Last Name&lt;/label&gt;  
    &lt;div class="col-md-5"&gt;
    &lt;input id="lname" name="lastName" type="text" placeholder="Last Name" class="form-control input-md"&gt;
  
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;!-- Multiple Checkboxes (inline) --&gt;
  &lt;div class="form-group"&gt;
    &lt;label class="col-md-4 control-label" for="professionalservices"&gt;Do you offer any of the services?&lt;/label&gt;
    &lt;div class="col-md-4" style="width:70%; margin-left:34%;"&gt;
      &lt;label class="checkbox-inline" for="professionalservices-0"&gt;
        &lt;input type="checkbox" name="professionalservices" id="professionalservices-0" value="1"&gt;
          BI  services
      &lt;/label&gt;
      &lt;label class="checkbox-inline" for="professionalservices-1"&gt;
        &lt;input type="checkbox" name="professionalservices" id="professionalservices-1" value="2"&gt;
        Resell vendor's  services
      &lt;/label&gt;
      &lt;label class="checkbox-inline" for="professionalservices-2"&gt;
        &lt;input type="checkbox" name="professionalservices" id="professionalservices-2" value="3"&gt;
        Consulting Services
      &lt;/label&gt;
      &lt;label class="checkbox-inline" for="professionalservices-3"&gt;
        &lt;input type="checkbox" name="professionalservices" id="professionalservices-3" value="4"&gt;
        Other  servies
      &lt;/label&gt;
      &lt;label class="checkbox-inline" for="professionalservices-4"&gt;
        &lt;input type="checkbox" name="professionalservices" id="professionalservices-4" value="5"&gt;
        No  services
      &lt;/label&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;/fieldset&gt;
  
  &lt;!-- Button --&gt;
  &lt;div class="form-group"&gt;
    &lt;label class="col-md-4 control-label" for=""&gt;&lt;/label&gt;
    &lt;div class="col-md-4"&gt;
           &lt;a href="javascript:addperson();" class="btn btn-success"&gt;Apply Now&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>Json Code:</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt; 
  
     function addperson(){
  
          alert("hello");
          var persons = JSON.stringify({
          "firstName": $('#fname').val(), 
          "lastName":$('#lname').val(),
          "Services":$('#services').val()
  
  
         });
  
      alert("test values are"+persons);
      console.log(persons);
  
         $.ajax({
             type: "POST",
             contentType: 'application/json',
             url: baseurl+"addperson/add",
             data: persons,
             dataType:"text",
             success:successmethod,
             error: function(data,status) {
              alert("Error  "+status);
             }
            });
  
     }
     function successmethod(data){
      alert("sucessfully stored values");
     }
     &lt;/script&gt;
  </code></pre>
  
  <p>In the above  code am able to take the values of each textbox but when it comes to checkbox,i want to retrive multiple checkbox values inside json and want to pass it to Ajax.Can anyone tell me how can i take the multiple checkbox values in to Json??Any Help would be Appreciated..</p>