hi folks
i´m trying to add 5 inputs values into a single input but i´m not having sucess
can anyone help me
i´ve done this code but the result in the final input are
export function button1_mouseIn(event, $w) {
$w("#input11").value = ($w("#input5").value + $w("#input6").value + $w("#input7").value +$w("#input8").value +$w("#input9").value + $w("#input10").value);
}
the result that i need in the result input must be 3
i need to add 1+0+0+0+1+1= 3
but i´m having the result = 100011
what am i doing wrong ?
can somebody help me ?
tks a lot
Hi Duda,
You need to convert the input’s value to a number first before peforming arithmetic operations.
Try this:
let num = Number($w(" #input5 ").value);
I hope this helps,
Yisrael
yisrael
i´ve tryed this code but still not working
the processe of sum ( add ) the inputs numbers are wrong in the final input
export function button4_click(event, $w) {
let num = Number($w(“#input5”).value);
let num1 = Number($w(“#input5”).value);
let num2 = Number($w(“#input5”).value);
let num3 = Number($w(“#input5”).value);
let num4 = Number($w(“#input5”).value);
let num5 = Number($w(“#input5”).value);
$w("#input11").value = num + num1 + num2 + num3 + num4 + num5 ;
}
can you help me
I can try to help, but you have to tell me what’s wrong.
I should also point out that you are using #input5 in each line of your code. Not sure if you meant this.
Yisrael
i´m sorry i did mistake
you are write
i´ve forgot to change de inputname
tahnks for your fast support