I have the following array of objects:
WhatIhaveofthisobjectistheindex,andIwanttousethisindextopopulateaform.
Inthefunctionbelow,fase
isarray
andID
istheindexoftheobject.
Butasitstands,Icanonlypopulatethefirstindex[0].
HowcanIdisplayinformationinthefieldsaccordingtothecorrectindex?
function_carrega_fase(fase,id){for(vari=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);}}
Ihopetheformdisplaystheinformationasbelow