Forums

Validating Multiselect dropdown

giorgosx 17 Jan, 2019
Hi!
How can I limit (validating) the selected options of a Multiselect dropdown? (for example three)
healyhatman 17 Jan, 2019
Answer
maxSelected[3] probably in the validation options.
giorgosx 18 Jan, 2019
Thank you healyhatman, but it is not working...
I also tried with "Validate data" action (relative_topics/maxSelected[3]:errormessage) and also no success.
healyhatman 18 Jan, 2019
OK got it for the front end.

maxCount[#] and minCount[#]

Still haven't figured out the back end sorry. For now you can just use custom PHP validation. Something along the lines of
if(count($this->data("dropdown_field")) > 3) { return false; }
healyhatman 18 Jan, 2019
It can be done with the validate data action, but it will require you to make changes to Chronoforms code. I can provide those changes for you, but they'll be overwritten if you update CF or CC. Better off waiting for Max to fix it in a later update, and just validate with PHP for the backend.
giorgosx 20 Feb, 2019
maxCount[#] and minCount[#] is yhe solution!
Thank you healyhatman
This topic is locked and no more replies can be posted.