Good day, I am using the code below to add to a value depending on a result. I want a #text25 to change depedning on input on #text30 and/or #text31.
I start by defining #text25 as 0 (zero). Not sure if I am doing it ocrrectly and then adding +3 within an IF statement.
Please help. I do not get anything to display on #text25 in live website. It is not giving me an error which makes it harder to troubleshoot.
import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;
$w.onReady( function () {
let score = 0 ;
$w(“#text25”).type = score ;
$w(“#dynamicDataset”).onReady( () => {
$w(“#repeater1”).forEachItem( ($w, itemData, index) => {
//Adding the points here
if ($w(“#text30”).text === “yes” || $w(“#text30”).text === “maybe”){
$w(“#vectorImage1”).show();
score = score + 3 }
else {
$w(“#line9”).show();
}
$w(“#text25”).type = score ;
if ($w(“#text31”).text === “yes” || $w(“#text31”).text === “maybe”){
$w(“#vectorImage2”).show();
score = score + 3 }
else {
$w(“#line10”).show();
}
$w(“#text25”).type = score ;
})
})
})