HTML
<html>
<table>
<tr>
<select id="Ultra" onchange="getForm()">
<option value="0.0">1</option>
<option value="1.0">2</option>
<option value="2.0">3</option>
<option value="3.0">4</option>
</select>
</tr>
<tr>
<td id="demo">
<script>
function getForm()
{
google.script.run.withSuccessHandler(myFunction).myFuncti();
}
function myFunction(arry)
{
var x = document.getElementById("Ultra").value;
for(i=0;i<arry.length;++i)
{
if(arry[i][0] == x)
{
var a = arry[i][1];
}
document.getElementById("demo").innerHTML = a;
}
}
</script>
</td>
</tr>
</table>
</html>
I have created a Drop down menu using select , after that I was calling client side function getForm(). In that function I was calling server side function myFuncti() using google.script.run class and this will return an array which I was passing to a client side function myfunction() as an parameter.
If use Logger.log(), the server side function is returning array values successfully !!
It's an 2D array .. Am I passing it in right way to myFunction() ?
If you couldn't understand anything in the question please add a comment I will reply