este es el codigo para la tabla
Código:
y este es el codigo del combo dependiente $(function () {
$('#tabla').on('click', 'tr a', function (e) {
e.preventDefault();
$(this).parents('tr').remove();
});
$("#addrow").click(function() {
$("#tabla").each(function () {
var tds = '<tr>';
jQuery.each($('tr:last td', this), function () {
tds += '<td>' + $(this).html() + '</td>';
});
tds += '</tr>';
if ($('tbody', this).length > 0) {
$('tbody', this).append(tds);
} else {
$(this).append(tds);
}
});
});
});
Código:
y este es el codigo de los combos $(document).ready(function(){
$("#cod_arti").change(function(event){
var id = $("#cod_arti").find(':selected').val();
$("#precio").load('combo_precios.php?id='+id);
});
});
Código PHP:
<td><select id="cod_arti" name="cod_arti[]"><option value="0">ARTÍCULO</option>
<?php while($row = $arti->fetch_assoc())
{
echo "<option value='".$row['id_arti']."'>".$row['codigo_arti']." | ".$row['categoria']."</option>";
}
?></select></td>
<td><input list="precio" placeholder="precio" name="precio[]" autocomplete="off" id="texto" size="10" required/>
<datalist id="precio[]">
</datalist></td>


