Hi, I’m trying to make an item registration/update page and I need multiple choice Checkboxes with limited number of the checks for the user to choose categories (3 categories, for instance.)
Checkbox in the repeating group with dynamic text…
In order to achieve this feature, I have set a checkbox within repeating group, and the text value is set to dynamic and loaded from a DB called “placeholder_ctgry”. On the workflow, I have also set a custom state and if the checkbox is checked, the value will be added to the custom state, I did the same for uncheck/subtracting and so if the user press the [update] or [register] button, all the selected and added values will be saved on the DB.
Limiting the number of the checks…
In order to limit the number of the check, I have used “input disable” in the condition(there is no “input unchecked” to be found so I used this to compromise), so if the value added to the custom state is >2 this input(checkboxes) will be disabled, and for the user to reset the selected values I’ve made [clear] button and this will clear the values in the custom states and enables the checkboxes once again, and these worked flawlessly!
But the problem is on the item update page.
Validating the values from previously selected values…
On the checkbox, I have also set a condition to validate if the values are already set or exist in the existing item so, if the value existed in the current-page-item in the DB and match with the value on the checkbox, I use [preset status “Checked”] and this way when the user loads the item update page, previously chosen categories are shown “checked” on the checkbox.
Reloading the previously selected values from DB to custom state on the page…
However, after I’ve set this condition I’ve noticed that if the validator is validating from the DB, you cannot use the subtract function to subtract the value since the values are sitting on the DB and not on the custom states. (and I don’t want to change the DB directly until user press the [update] button) So, I have made a one time action in the workflow, if the custom states has 0 value, load the values from DB to custom state. Boon! I thought it’s done but no…
I see checkboxes with previously chosen categories indicating “checked” and also see the existed values in the debugger on my test page, but if I uncheck the checkbox it won’t subtract these values and its the same for the adding but they are counted as checked so the “limiting number of the check” function work just fine… (btw, if I click the [Clear] button to clear the custom state, everything works as I wanted, but no luck when the page is loaded and until I hit the [clear].)
Why is this happening? If the value is once stored in the DB from the custom state, the value will be different from the value stored in the custom state directly from the page?
Sorry about my terrible english but I hope you understand what im trying to achieve here and my problem, if you think you can help please please please let me know. I will much appreciate your help and thx 10000 in advance.