kaito
Member
Hi to everybody:
For a checkbox element I want to set a maximum value for checked items.
I looked for in the forum and found this post: https://fabrikar.com/forums/index.php?threads/howto-limit-the-number-of-selections-for-checkbox-element.20557/
using a PHP validation based in counting separator character of the values stored in the element value, I set PHP validation for a maximum of 3 items checked, so there will be a maximum of 3-1=2 separator characters:
I have tried with different separator characters as "-" or "," with no efect, when I try to run the form, there is a validating icon appearing with no end.
Is there any way to know the syntax about how checkbox element stores temporally checked values? If I know it, then I can look for that separator caharacter using substr_count function.
Or is there any other way to set a maximum value for checked options?
Thanks in advance,
kaito
For a checkbox element I want to set a maximum value for checked items.
I looked for in the forum and found this post: https://fabrikar.com/forums/index.php?threads/howto-limit-the-number-of-selections-for-checkbox-element.20557/
using a PHP validation based in counting separator character of the values stored in the element value, I set PHP validation for a maximum of 3 items checked, so there will be a maximum of 3-1=2 separator characters:
PHP:
If ("substr_count({afab_votacioncursotipo01___comocalificariasalponente_raw}","-") > 2)
{
return false;
}
else {
return true;
}
I have tried with different separator characters as "-" or "," with no efect, when I try to run the form, there is a validating icon appearing with no end.
Is there any way to know the syntax about how checkbox element stores temporally checked values? If I know it, then I can look for that separator caharacter using substr_count function.
Or is there any other way to set a maximum value for checked options?
Thanks in advance,
kaito