1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <table>
<tr>
<td class="col-md-4"><input type="text" id="Production" class="form-control" placeholder="Libellé" name="inputLProd[]" value="" /></td>
<td class="col-md-2"><input type="text" id="Production" class="form-control" placeholder="0" name="inputMProd[]" value="" /></td>
<td class="col-md-6"></td>
</tr>
<tr>
<td><a href="javascript:void(0);" class="addPROD"><span class="glyphicon glyphicon-plus-sign" style="line-height:2;" aria-hidden="true"></span> Ajouter une ligne</a></td>
</tr>
</table>
<script type="text/javascript">
$(document).ready(function () {
$('.addPROD').click(function () {
$('#Production').append('<tr><td class="col-md-4 col-md-offset-3"><input type="text" id="Production" class="form-control" placeholder="Libellé" name="inputLProd[]" value="" /></td><td class="col-md-2"><input type="text" id="Production" class="form-control" placeholder="0" name="inputMProd[]" value="" /></td><td><a href="javascript:void(0);" class="remPROD"><span class="glyphicon glyphicon-minus" style="line-height:2;" aria-hidden="true"></span></a></td></tr>');
});
$('#Production').on('click', '.remPROD', function () {
$(this).parent().parent().remove();
});
});
</script> |