0
I have the following object array:
What I have of this object is the index, and I want to use this index to populate a form.
In the function below, fase
is the array
and ID
is the index of the object.
However, as it stands, I can only popular the first index[0].
How can I display information according to the correct index in the fields ?
function _carrega_fase(fase, id) {
for (var i = 0; i < fase.length; i++) {
$('#txt_atraso_inicial_alt').val(fase[i].atraso_inicial);
$('#txt_atraso_final_alt').val(fase[i].atraso_final);
$('#txt_multa_alt').val(fase[i].multa);
$('#txt_juros_alt').val(fase[i].juros);
$('#txt_honorario_alt').val(fase[i].honorario);
}
}
I hope the form displays the information as below
Can you give an example of how HTML is expected to look? As it is now you are over-writing the same elements in HTML.
– Sergio
@Sergio, I have one
Option Select
, that contain the delay range(I will use theindex
of this select to load the other object information, andpopover
with themulta
,juros
andhonorario
.– Wagner Fillio
I put an HTML image of how I hope it looks.
– Wagner Fillio