I have tried to take two user inputs and multiply them together using a simple code:
Back-end looks like this:
export function multiply(factor1, factor2) {
return factor1 * factor2;
}
Simply multiplying to input statements
The front-end looks like this:
import {multiply} from ‘backend/SimpleTestFunc’;
$w.onReady( function () {
});
export function button1_click(event) {
multiply($w(“#input1”),$w(“#input2”))
.then(product => {
console.log(product);
})
. catch (error => {
console.log(error);
});
}
It is in this part i think the problem is:
multiply($w(“#input1”),$w(“#input2”))
I have tried to change the type of input of #input1 and #input2 to number and text, though it have not worked.
Then I manually set numbers in the multipy func it works, but using the above code it simply returns null.
I have tested the buttom1_click(event) and it works.
That´s wrong
thank you
- Erik