Hi i-m trying to multiply input field value but i´m not having sucess in it
Can anyone help me
I need to multiply a Produt Sale Value - $w("#input2").value
with the Saler Committee - $w("#input6").value
i need to display the result in another input field - $w("#input5").value
BUT IS SHOWING A WORD NaN on the input field
i set all both to numbers
let num = Number($w("#input2").value); let num1 = Number($w("#input6").value); let num2 = Number ($w("#input5").value) - THIS ONE IS A PORCENTAGE % $w("#input5").value = (num * num1);
Can Anyone help me ?
I'm still trying to figure this out. Please help. I have put the following code into my Page code on the page I want the multiplication to occur:
Essentially what I want to do is multiply two custom form inputs and display the product on the review page. It will help my customers choose the correct subscription based on what they filled out in the custom form. I will be multiplying #classDuration times #hoursWeekly to get the product #hoursMonthly. They are all number fields, so it should be working. Do I have to do this in a Public or Backend file, or can it be the Page code?
$w.onReady(function () { let num = Number($w("#classDuration").value); let num1 = Number($w("#hoursWeekly").value); let num2 = Number ($w("#hoursMonthly").value) let mul= (num*num1); mul = parseFloat(mul); $w("#hoursMonthly").value = " " +(num * num1); });
Good day I have same problem please help me : i want to make addition in my data base collection in the field form like for example: input1 + input2 = input3
please help what is the code i will use im new......
Hi Duda,
Is your input type set to 'Number' in all input boxes ?
If not, please change it (click on each box, then select 'Set Input Type').
If this doesn't help, please send the url of your site so I can check it.
Thanks,
Itay
it still with Nan
let num = Number($w("#input2").value); let num1 = Number($w("#input6").value); let num2 = Number($w("#input5").value); let mul= (num*num1); mul = parseFloat(mul); $w("#input5").value = " " + mul;
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat
let mul= (num*num2);
mul = parseFloat(mul);
$w("#input5").value = " " + mul;
how do i set into number ?
yes in preview
Duda Aleo
NaN means not a number......So You have to convert it to number
Are u running it in preview .
Sailen continue with the same result
NaN
Try this,
$w("#input5").value = " " +(num * num1);