0

I have a list of items in check boxes. A user can mark as many as they want when filling in the form. However, I want an error if the user chooses "Pre-roll" and any other item. I'm able to figure out all but the "other" fill in box. How do I write that into the custom error?

enter image description here

I'm currently doing this for my custom error:

=(CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("300x250")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("728x90")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("320x50")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("300x100")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("Expanding video banner")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("1200x700")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("700x1200")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("480x320")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("Mobile floorboard/adhesion")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("500x800")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("800x500")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("600x60")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("700x700")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("Parallax")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("Pushdown")) or (CreativeSizes.Contains("Pre-roll") and CreativeSizes.Contains("Native"))

Is there anyway to trigger that custom error on the fill in box as well as all of the other options?

1 Answer 1

1

I'm a developer for Cognito Forms.

I believe the custom error calculation that you've shared can be simplified a bit, and will throw when "Pre-roll" and any other item (including the "Other" fill in box) is selected by using the following calculation:

=CreativeSizes.Contains("Pre-roll") and CreativeSizes.Count()>1

This is telling your field to throw the error when "Pre-roll" is selected, and when the count of items selected is greater than 1. This will include all of the other selections, including the "Other" fill in box.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.