-1
Hello!
I’m assembling a feature where I need to send multiple chosen records in a grid by clicking on their checkbox... does anyone know how to save these chosen id’s and send via ajax/jquery to a php file that will perform another process?
code:
html:
<select class="btn_dGrid_btnActionWithSelecteds" name="btn_dGrid_btnActionWithSelecteds">
<option value="">Ação com os Selecionados</option>
<option value="opt1">Opção1</option>
</select>
jquery:
$(".btn_dGrid_btnActionWithSelecteds").change(function(){
var id_escolhido = $(".dynamicGridCheck").val();
$.ajax({
url: "engine/php/gerar.php?&&id_escolhido="+id_escolhido,
success: function( data ){
alert(data);
}
});
railing:
<tr>
<td><input type="checkbox" value='$id'></td>
<td>Registro1</td>
</tr>
<tr>
<td><input type="checkbox" value='$id'></td>
<td>Registro2</td>
</tr>
generate.php:
$id_escolhido []= $_REQUEST['id_escolhido'];
foreach($id_escolhido as $ids){
echo "id: ".$ids;
echo "\n";
}
...Currently only one record appears in php, but I select several...