title: Form.Serialize with checkbox array
body: <p>I'm submitting a form through JQuery by using the form.serialize method. But that same form has an array of checkboxes, which is dynamically genetrated by a PHP function
  This is the form:</p>
  
  <pre><code>&lt;form class="form" id="formNewClient" role="form"&gt;
              &lt;ul class="nav nav-tabs"&gt;
                  &lt;li class="active"&gt;&lt;a href="#clientdata" data-toggle="tab"&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt; Dados Cliente&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#phoneparkdata" data-toggle="tab"&gt;&lt;i class="fa fa-phone"&gt;&lt;/i&gt; Dados Phonepark&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;div class="tab-content"&gt;
          &lt;div class="tab-pane active" id="clientdata"&gt;
              &lt;div class="row"&gt;
              &lt;div class="col-md-12"&gt;
                              &lt;div class="page-header"&gt;&lt;h3&gt;Dados Pessoais&lt;/h3&gt;&lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="form-group col-md-8"&gt;
                              &lt;label for="name"&gt;Nome Completo:*&lt;/label&gt;
                              &lt;input type="text" name="clientName" class="form-control" placeholder="Nome Completo do Utilizador"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="form-group col-md-8"&gt;
                              &lt;label for="email"&gt;Email:&lt;/label&gt;
                              &lt;input type="text" name="clientEmail" class="form-control" placeholder="Email Utilizador"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="form-group col-md-8"&gt;
                              &lt;label for="addressone"&gt;Morada:&lt;/label&gt;
                              &lt;input type="text" name="clientAddressone" class="form-control" placeholder="Morada do Utilizador"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt; 
                          &lt;div class="form-group col-md-6"&gt;
                              &lt;label for="address2"&gt;Morada (cont.):&lt;/label&gt;
                              &lt;input type="text" name="clientAddresstwo" class="form-control" placeholder="Morada do Utilizador (cont.)"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group col-md-3"&gt;
                              &lt;label for="postalcode"&gt;Código Postal:&lt;/label&gt;
                              &lt;input type="text" name="clientCPostal" class="form-control" placeholder="Código Postal"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group col-md-3"&gt;
                              &lt;label for="city"&gt;Localidade:&lt;/label&gt;
                              &lt;input type="text" name="clientCity" class="form-control" placeholder="Localidade"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="form-group col-md-4"&gt;
                              &lt;label for="clientNif"&gt;NIF&lt;/label&gt;
                              &lt;input type="text" name="clientNif" class="form-control " placeholder="NIF"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group col-md-4"&gt;
                              &lt;label for="clientBirthdate"&gt;Data de Nascimento&lt;/label&gt;
                              &lt;div class="form-group"&gt;
                  &lt;div class='input-group date' id='inputendDate' data-date-format="YYYY/MM/DD"&gt;
                  &lt;input type='text' name="clientBirthdate" class="form-control" /&gt;
                  &lt;span class="input-group-addon"&gt;&lt;span class="glyphicon glyphicon-time"&gt;&lt;/span&gt;
                  &lt;/div&gt;
                  &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group col-md-4"&gt;
                              &lt;label for="sex"&gt;Sexo:&lt;/label&gt;
                              &lt;br&gt;
                          &lt;label class="radio-inline"&gt;
                              &lt;input type="radio" name="optionsRadioSex" value="M"&gt;
                              Masculino
                          &lt;/label&gt;
                          &lt;label class="radio-inline"&gt;
                              &lt;input type="radio" name="optionsRadioSex" value="F"&gt;
                              Feminino
                          &lt;/label&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
          &lt;/div&gt;
          &lt;!--END CLIENTDATA--&gt;
          &lt;div class="tab-pane" id="phoneparkdata"&gt;
              &lt;div class="row"&gt;
                          &lt;div class="col-md-12"&gt;
                              &lt;div class="page-header"&gt;
                                  &lt;h3&gt;Dados Phonepark&lt;/h3&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-12"&gt;&lt;h4&gt;Documentos:&lt;/h4&gt;&lt;/div&gt;
                          &lt;div class="form-group col-md-4"&gt;
                              &lt;label for="document"&gt;Tipo de Documento:&lt;/label&gt;
                              &lt;select name="documenttype" class="form-control"&gt;
                                  &lt;?php selectListDocuments();?&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group col-md-4"&gt;
                              &lt;label for="documentNumber"&gt;Número do Documento:*&lt;/label&gt;
                              &lt;input type="text" name="documentNumber" class="form-control"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group col-md-4"&gt;
                              &lt;label for="documentNumber"&gt;Número do Documento (Secundário):&lt;/label&gt;
                              &lt;input type="text" name="documentNumberSec" class="form-control"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-12"&gt;&lt;h4&gt;Comunicações:&lt;/h4&gt;&lt;/div&gt;
                          &lt;div class="form-group col-md-4"&gt;
                              &lt;label for="phone1"&gt;Telemóvel:*&lt;/label&gt;
                              &lt;input type="text" name="clientPhonePri" class="form-control"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group col-md-4"&gt;
                              &lt;label for="phone2"&gt;Telemóvel Secundário:&lt;/label&gt;
                              &lt;input type="text" name="clientPhoneSec" class="form-control"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="form-group col-md-6"&gt;
                              &lt;h4&gt;Perfil:&lt;/h4&gt;
                              &lt;label for="profile"&gt;Perfil(s) a utilizar:*&lt;/label&gt;
                              &lt;?php 
                                  profileCheckBoxes();
                              ?&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="form-group col-md-6"&gt;
                              &lt;label for="activationDate"&gt;Data de Activação:&lt;/label&gt;
                              &lt;div class="form-group"&gt;
                  &lt;div class='input-group date' id='inputactivationDate' data-date-format="YYYY/MM/DD hh:mm"&gt;
                  &lt;input type='text' name="clientActivationTime" class="form-control" /&gt;
                  &lt;span class="input-group-addon"&gt;&lt;span class="glyphicon glyphicon-time"&gt;&lt;/span&gt;
                  &lt;/div&gt;
                  &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group col-md-6"&gt;
                              &lt;label for="limitDate"&gt;Data de Limite:&lt;/label&gt;
                              &lt;div class="form-group"&gt;
                  &lt;div class='input-group date' id='inputendDate' data-date-format="YYYY/MM/DD hh:mm"&gt;
                  &lt;input type='text' name="clientDeactivationTime" class="form-control" /&gt;
                  &lt;span class="input-group-addon"&gt;&lt;span class="glyphicon glyphicon-time"&gt;&lt;/span&gt;
                  &lt;/div&gt;
                  &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;!--END PHONEPARKDATA--&gt;    
              &lt;/div&gt;
      &lt;!--END TAB-CONTENT--&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-4 col-lg-4 pull-right"&gt;
              &lt;button type="submit" class="btn btn-success" name="submitNewClient" id="submitNewClient"&gt;&lt;i class="fa fa-plus"&gt;&lt;/i&gt; Adicionar Cliente&lt;/button&gt;
                      &lt;button type="button" class="btn btn-danger" data-dismiss="modal"&gt;&lt;i class="fa fa-times"&gt;&lt;/i&gt; Cancelar&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>And this is the php function that generates the checkboxes:</p>
  
  <pre><code>function profileCheckBoxes(){
  $queryListProfiles = "SELECT * FROM perfil";
  $listProfiles = mysqli_query($GLOBALS['dbc'],$queryListProfiles);
  $numProfiles = mysqli_num_rows($listProfiles);
  if($numProfiles !=""){
    while($row = mysqli_fetch_array($listProfiles)){
      ?&gt;
      &lt;label class="checkbox-inline"&gt;
        &lt;input type="checkbox" value="&lt;?php echo $row['id']?&gt;" name="profiles[]"&gt;
        &lt;?php echo $row['Nome']; ?&gt;
      &lt;/label&gt;
      &lt;?php
    }
  }
  }
  </code></pre>
  
  <p>How can I submit the form with form.serialize in Jquery and in the PHP side process the checkbox so I can extract the values from the checkbox array?</p>