Hi, a user can choose categories. When he clicks on the button add categories, there should be a change of the current users categories (list in the database) and all checked categories of the checkbox should be added. This should only happen, when at least three categories are checked.
Hi there, @Jakob1… one way you could go is to store the selected categories in a custom state list (which would have the same type as the categories), and disable the button until a count of the categories in the list is greater than or equal to three. Then, when the button is clicked, add the custom state list to the user’s categories, and you should be good to go.
Note that you would also need a workflow to remove a category from the custom state list when a checkbox is unchecked for a category that is already in the list. Both of the workflow events (i.e., the one that adds a category to the list and the one that removes it) would use the An input’s value is changed event, and each one would have an appropriate condition on it (i.e., the first one would run only when the category is not in the list, and vice versa for the second one).
First, I have an option set called OS Categories that defines the categories. Then, I have a custom state called selected categories on the index page, and the state holds a list of OS Categories.
The workflow event that removes the current cell’s category from the custom state when a checkbox is unchecked is the same as above, with obvious changes where the custom state contains the current cell’s category and using minus item instead of plus item.
Finally, the workflow associated with the Add Categories button looks like this.
And sorry for the late reply, I had a lot to do for school the last few days and wasn’t able to try it immediately.
I have a small follow up question. The users should choose the 3 categories in the sign up process. It should not be possible to use the website without having selected at least 3 categories. I already have the workflow that if email confirmed is no, the user will be redirected to the index page. Where would you recommend to let the user select the categories. Before the confirmation email is sent?
It sounds like you should just disable the sign-up button until 3 categories are selected. There’s no point in letting the user sign up if they can’t use the site because they haven’t selected 3 categories, right?
I want that the present status of the checkbox is dynamic. The checkbox of the categories that the user has checked should still be checked when he opens the popup the next time. The others should not be checked. Do you know how to do that?
Oh ok, is there any other way to do it? When the user opens the popup again after a certain time, the previously checked checkboxes should still be checked.
I tried it like this. If the current user’s categories which are stored in the database contain this groups category. But it doesn’t work either.