Hello, I have a problem with javaScript.
I use two pages, that are named "Startas" and "Rezultatas" accordingly.
The first page has two inputs and a button, and when I push it it should get the two inputs and add them if they are two-digit numbers, but instead it just shows those two numbers on the second page in the LABEL component. I would like to know how should i write the code to make the label element show the sum of the two inputs, instead of those inputs
codevar pirmas = Appery('Input1').val();
var antras = Appery('Input2').val();
var rezultatas;
if (((10<=pirmas) && (pirmas <= 99)) && ( (10 <= antras) && (antras <= 99)) )
{
rezultatas = (pirmas + antras);
}
else
{
rezultatas="Iveskite tik dvizenklius skaicius"
}
localStorage.setItem('Atsakymas' , rezultatas);
Appery.navigateTo('Rezultatas' , {});
/code
and the second page code:
prevar atsakymas = localStorage.getItem('Atsakymas');
Appery('Output').text(atsakymas);
/pre