Witam
Próbuję pobrać dynamicznie z bazy google sheets dane poprzez combobox i wstawić je do dopowiednich input box.
Tylko nie potrafię ogarnąć się z tym tematem.Chciałbym, aby po wybraniu opcji z combo dynamicznie pobierał dane znajdujące się w tym samym wierszu, ale innej kolumnie
Próbowałem tak:
function loadCars(){
google.script.run.withSuccessHandler(function(ar){
var carSelect=document.getElementById("cars");
let option=document.createElement("option");
option.value="";
option.text="";
carSelect.appendChild(option);
ar.forEach(function(item,index)
{
let option=document.createElement("option");
var n1=item[0];
var n2=item[1];
var n3=item[2];
// option.value=n2+','+n3; //+','+n3;
// option.value=n3;
option.value=n2;
option.text=n1;
carSelect.appendChild(option);
document.getElementById("carValue").value=n2; // ale tu pobiera na sztywno wartość item[0]
document.getElementById("carValue1").value=n3;
};
});
}).getData();
};