SDK error, item is not of array? Please Help!

So this is the code


the goal of this code is to set a value to a checkbox onready.

so when not checked for it to equal nothing

when checked for it to equal 20

You are using checkbox so you can’t set a checkbox value to ‘’.

Have a look at the Checkbox API.
https://www.wix.com/corvid/reference/$w.Checkbox.html
https://www.wix.com/corvid/reference/$w.Checkbox.html#value
https://www.wix.com/corvid/reference/$w.Checkbox.html#checked

Also, search this forum for previous posts as there are plenty with checkboxes.
https://www.wix.com/corvid/forum/community-discussion/linking-a-checkbox-to-a-button-for-accepting-t-c
https://www.wix.com/corvid/forum/community-discussion/empty-checkbox-in-database-is-not-false
https://www.wix.com/corvid/forum/community-discussion/uncheck-a-checkbox-if-another-checbox-is-checked
https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-checkbox-dropdown
https://www.wix.com/corvid/forum/community-discussion/help-with-checkboxes-select-all-that-apply

Although, note that if you don’t want it to be ticked by default when the page is loaded, then just simply set that in the checkbox settings itself, highlighted in the blue frame below.
https://support.wix.com/en/article/adding-and-setting-up-a-checkbox

thank you so much for your help!!!

Hey, I need help can you please make a example code on how to have a calculator where there are checkboxes and depending on which ones they click on it adds them together to show on a text element total multiplied by user input “Square Footage”. for example | Checkbox 1 = 10 . + Checkbox 2 =20 + Checkbox 3 = 30 * Input value | tester selects check box 1 and 3 so it would be 40 * whatever number he types into the user input let say he typed in 50 into the user input it would be 40 * 50 which would equal 200 and the total would appear on a text element. if you need more info for this to make sense please call me 4254446817 or email me thegotocontractors@ gmail.com or reply here on youtube thanks!!!

@thegotocontractors We are unable to provide full code solutions. Wix provides many resources to help users learn how to get the most out of Corvid. We encourage users to take advantage of these resources which include video tutorials, full app examples (which can be loaded into the user’s editor), API documentation, and a wealth of articles describing a wide range of topics - from beginner to advance.

You may want to check out the WixArena - it’s a hub where you can look for Corvid (and other) experts for hire.

Further to Yisrael’s post above, you have posted multiple posts all about the same or very similar question, which you have used different elements of checkboxes and checkbox groups.

So note that checkbox and checkbox groups are different and have different code for each of them.

Checkboxes you can get the individual value.
https://www.wix.com/corvid/reference/$w.Checkbox.html
https://www.wix.com/corvid/reference/$w.Checkbox.html#value

Whereas checkbox groups the values are saved in an array
https://www.wix.com/corvid/reference/$w.CheckboxGroup.html
https://www.wix.com/corvid/reference/$w.CheckboxGroup.html#value
The same as if you set the options for the checkbox group too, it is all in an array.
https://www.wix.com/corvid/reference/$w.CheckboxGroup.html#options

if you want to add values together in an array you can look at using sum or reduce, which might sound wrong to you, however it does the job!
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
https://www.w3schools.com/jsref/jsref_reduce.asp
https://codeburst.io/javascript-arrays-finding-the-minimum-maximum-sum-average-values-f02f1b0ce332
https://www.w3resource.com/javascript-exercises/javascript-math-exercise-17.php
https://medium.com/@chrisburgin95/rewriting-javascript-sum-an-array-dbf838996ed0

In this post above and in this post linked below you are using checkbox group and hence why you are getting the array message when you are trying to write code as if you are using checkboxes only.
https://www.wix.com/corvid/forum/community-discussion/please-help-calculation-error-and-item-array-error

Whereas in this post, you write the code as if you are using checkboxes which is right,
https://www.wix.com/corvid/forum/community-discussion/sdk-error

Therefore as you have posted multiple posts about the same thing two posts will be closed and the only one left open will be the one where you have used checkboxes and checkbox code and not checkbox groups with code for checkboxes.