What happens is that I need to perform an exercise that fills me with a php class or show me a list.
index.php
<div class="container">
<table class="table table-bordered">
<tr>
<th colspan="5">
List
</th>
</tr>
<tr>
<th>
Producto 1:
<input type="hidden" name="cta" value="<?php echo $cta; ?>">
</th>
<td>
<select id="list" class="form-control" name="list" required>
<option value="">Select please...</option>
<?php $ObjUtilidades->Select("prod_codigo, prod_descripcion","productos","prod_descripcion", "where prod_indicativo=1"); ?>
</select>
</td>
</tr>
<tr>
<td>
<div id="listadd"></div>
</td>
</tr>
</table>
<table>
<tr>
<td colspan="2">
<button type="button" name="button" class="btn btn-primary" onclick='agregar_campos_kts()'>Add</button>
</td>
</tr>
</table>
</div>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript">
var contador0=1;
function agregar_campos_kts()
{
contador0++;
$('#cta_campos').val(contador0);
$('<tr class="contra'+contador0+'"><td><p>Producto '+contador0+' </p></td>\n\
<td colspan="3"><select id="producto1" name="producto1" class="form-control">\n\
<option value="">Select please... </option>\n\
<?php $ObjUtilidades->Select("prod_codigo, prod_descripcion","productos", "prod_descripcion", "where prod_indicativo=1"); ?>\n\
</select></td>\n\
<td><p>Consumo</p></td>\n\
<td><input type="text" class="form-control" id="consumo'+contador0+'" name="consumo[]" required dir="rtl" ></td>\n\
<td style="color:transparent;border:none;background:url(../img/deletered.png) no-repeat;no-repeat;background-size:90% 60%;margin-top:3% 0% 0% 0%;">\n\
<input type="button" id="elimi'+contador0+'" class="eliminar" value="'+contador0+'" ></td>\n\
</tr>alert(contador)').appendTo( "#listadd" );
$("input.eliminar").click(function()
{
var es=alert('Seguro que desea Eliminar');
var estu=$(this).attr("value");
$(".contra"+estu).remove();
});
}
</script>
Ready, there's a good one, show me what the list is ... List: Data Data and so What I want is that with the JavaScript to do so I show the list again ... In the inspection I see the list and if it is displayed ... But in the inspection but not in the list. It says the error: Uncaught SyntaxError: missing) after argument list
The error is clear, missing a parenthesis but check the code and I have nothing to close ...