Create a Page to Check values of Items from Collection

Hey,
I am trying to create a checker. So you choose 6 items from a Collection, but each item has an assigned value. I want to then say whether this value is Over or Equal/Under a specific value, but i’m not quite sure how to do the calculation side…

Hallo Kris Scott,

i think you can do it in a separate function.

So you have for example 6xDropDowns where your values are connected to

DD1 = DropDown1
DD2
DD3
…and so on

Then you create on each DropDowns ----> an “onChange-EventHandler”
“Do something when a DropDown has change his value”

myOnChange-Event
{call a function for example —> DoSomething()}

function DoSomeThing()
{…here your code (calculate or what ever)}

something like that.

I am quite a novice at that, would that be adding an element or in the page code?

…to be continued… sorry for the wrong post

little example:
DD1=DropDown1 (dropdown1 has the value —>10)
you wanna compare the value of DD1 with the number 5 and you wanna know, if it is higher/equal or lower)

So you create a FUNCTION

function CALCULATION(){
if ($w( ‘#DD1’ ).value == 5 ) {console.log( “The compared NUMBER is EQUAL” )}
else if ($w( ‘#DD1’ ).value > 5 ) {console.log( “The compared NUMBER is BIGGER than 5” )}
else if ($w( ‘#DD1’ ).value < 5 ) {console.log( “The compared NUMBER is SMALLER than 5” )}
}

Now you have your function which can do all your callculations.

At least you have just to start this function by an event, for example by changing the dropdown1-menu…

every time you change the dropdown1, the CALLCULATION-function will be called/started.

export function DD1_change(event) { CALCULATION() }