I have to edit the details of a referral guide for which I have the following code that loads the values of the detail table
<tbody>
@foreach($detalles as $det)
<tr>
<input type="hidden" name="id_detalle[]" value="{{ $det->id_detalle }}">
<td><input style=" width : 60px; border: none " type="number" name="cantidad[]" id="cantidad" value="{{ $det->cantidad }}"></td>
<td><input style=" width : 600px; border: none " type="text" readonly name="descripcion[]" id="descripcion[]" value="{{ $det->descripcion }}"></td>
<td><input style=" width : 90px; border: none " type="number" step="0.01" name="v_unitario[]" id="v_unitario" value="{{ $det->v_unitario }}"></td>
<td><input style=" width : 90px; border: none " type="number" readonly id="v_parcial" name="v_parcial[]" value="{{ $det->v_parcial }}"></td>
</tr>
@endforeach
The next thing is to capture the quantity and v_unit values and in a v_partial array what I do is multiply v_parcial = amount * v_unit as follows
function cantidad()
{
//Obtengo todos los campos con el nombre cantidad[]
var cantidad = document.getElementsByName("cantidad[]");
var v_unitario = document.getElementsByName("v_unitario[]");
//Creo el arreglo donde almaceno sus valores
var cant = [];
var unit = [];
var parc = [];
//Recorro todos los nodos que encontre que coinciden con ese nombre
for(var i=0;i<cantidad.length;i++){
//Añado el valor que contienen los campos
cant.push(cantidad[i].value);
unit.push(v_unitario[i].value);
parc[i] = cant[i]*unit[i];
}
}
my question is how to store the values of the "parc" array in the
<input id="v_parcial" name="v_parcial[]">