I have a problem getting values of multiple selection of a valuelist. I have a valuelist for days of the week (sunday|1, monday|2, etc.) I have these as a set of checkboxes in one form. When I click on one of these checkboxes and select them, I can get the value of that checkbox (for example when I click tuesday I can get 3 back in my code) but when I click more than one checkbox I can’t seem to get the values all somehow supposedly in an array.
I need to get all the selected values onDataChange but the method just get triggered when one of the checkboxes are ticked. Anyone knows how can I get all the selected values in some sort?
Bind it to the dataProviderId property of the checkbox group
In the dataOnChange the form variable will contain all numbers of the days that have been clicked.
You must realize however that the dataOnChange will be fired for each day you click and the string will be built sequentially.
Hi Omar,
thanks for your reply. But the issue is that I already have the form variable as a dataprovider for these checkboxes and when I first click on one of the days, it will trigger the ondatachange method and puts the variable in it, but after the first selection the variable is not holding anything else, basicaly the ondatachange method doesn’t get called in order to override the value.
Well, strange thing happened! I tried to run the code again and now it works as it’s supposed to! the only thing I changed was instead of assigning null to the dataprovider variable as an initial value, I declared it as a an empty string and now everything works! I don’t know if that was the problem but that solved my issue anyway.