Trying out Wix code, amazed by the flexibility but baffled by a simple problem, probably due to my lack of code experience:
I have 10 ratings input items on a page that will feed into a collection. Each rating input is 0 to 5 using stars. I want to make sure users only allocate a maximum of 30 stars across the 10 inputs. I therefore want to do two things:
1. I want to display to users in a text box the amount of stars they have left, out of 30, to place in the various ratings inputs.
2. I want to prevent users from submitting their ratings if they use more than 30 stars across all 10 inputs.
I have placed a text box on the page, which I have labelled AttributeSum, to show the remaining stars that users can place. The ratings inputs are labelled ratingsInput1 and so on until ratingsInput10.
Could anyone suggest the right code to use to make 1. and 2. happen please? I'm confused between sum( ), aggregate( ) and other choices.
Thanks in advance for any hint in the right direction :-)