I am using a DataTable
to display information and I have a select
with another group of data
I would like to be able to give it to the $_POST
fix the value that I select in the table and the select one. This last one I have, but I do not know how I can add the value of the row at the moment of executing the POST
with the button
I capture the data with the following JS
$('#tClientesEmb tbody').on('click','tr', function(){
var data = table3.row($(this).closest('tr')).data();
//console.log(data[0]);
});
How can I insert that data[0]
to use it in the controller?
So I have the code in sight
<?php echo form_open('Config/AsocCliEmb'); ?>
<div class="form-group" >
<div class="row">
<div class="col-sm-9" id="cAsocEmb">
<table id="tClientesEmb" class="display" cellspacing="0" width="100%">
<thead>
<tr class="tClientesEmb" data-id="id">
<th>N Embarque</th>
<th>Fecha Emb.</th>
<th>Destinatario</th>
<th>Referencia</th>
<th>Cajas</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="col-sm-3">
<label for="Cliente" class="control-label col-sm-3">Cliente</label>
<select id="cliente" name="cliente" class="selectpicker">
<?php foreach ($clientes as $c) echo '<option value="'.$c->id.'">',$c->nombre,'</option>'; ?>
</select>
<div class="form-group"> <!-- Submit Button -->
<div class="col-sm-9 col-sm-offset-2">
<button type="submit" class="btn btn-primary">Guardar</button>
</div>
</div>
</div>
</div>
</div>
<?php echo form_close();?>