Pasar datos en Tabla
Publicado por Benjamin (2 intervenciones) el 25/09/2018 05:46:55
Hola, tengo el siguiente codigo donde lo que requiero es pasar el valor que tiene mi campo com ID precio a mi campo con ID precio2, al momento que se este escribiendo o dar click en el submit, ya lo he intentado copiando lo valores de un input a otro y solo funciona en la primer fila y en las demas ya no.
Espero puedan ayudarme
Espero puedan ayudarme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<table id="mytable" class="table table-bordered table-hover">
<thead>
<th>Codigo</th>
<th>Nombre</th>
<th>Precio</th>
<th>Cantidad</th>
</thead>
<?php
$products_in_cero=0;
foreach($products as $product):
$q= OperationData::getQByStock($product->id,StockData::getPrincipal()->id);
?>
<?php
if($q<=0):?>
<tr>
<td style="width:80px;"><?php echo $product->id; ?></td>
<td><?php echo $product->name; ?></td>
<td>
<input type="" class="form-control" required id="precio" placeholder="Precio">
</td>
<td>
<form method="post" action="index.php?action=addtocart2">
<input type="hidden" name="product_id" value="<?php echo $product->id; ?>">
<input type="" id="precio2" name="monto">
<div class="input-group">
<input type="" class="form-control" required name="q" placeholder="Cantidad ...">
<span class="input-group-btn">
<button type="submit" id="boton" class="btn btn-primary"><i class="glyphicon glyphicon-plus-sign"></i> Agregar</button>
</span>
</div>
</form>
</td>
</tr>
<?php else:$products_in_cero++;
?>
<?php endif; ?>
<?php endforeach;?>
</table>
Valora esta pregunta
0