How do I allow users to select 3 courses in confiforms?
Asked by Peter Liu:

A supervisor in different branch of my division asked me: to

* Create a new EWIL Fusion Classroom Training page using the content of the attached Word Document.

Is there a way that you can create a voting capability on this new page that would allow users to pick their top 3 courses?

I added ConfiForms Rules for Field Defnition and set validation rule in it. BUt it still allowed me to choose more than 3 courses  
Earlier this morning, I thought about using multi-select drop down. But I don't know how to limit that option to 3  
Also, I asked a computer scientist to help me. But he said the following:  
\[1/12 10:20 AM\] Wu, Dennis V CIV USN NAWCWD (USA)  
yeah; i was experimenting with the validation rules with your page (copied to my personal) and was not able to get it to work. I am starting to think that _count doesnt do what i thought it would do  
\[1/12 10:25 AM\] Wu, Dennis V CIV USN NAWCWD (USA)  
i tried validation rule(s) within the checkbox and also tried with the 'ConfiForm Rules for Field Definition' macro. no luck


Answers:
author: Alex Medved _ConfiForms_
body: Hi

(I suggest to remove the names of your colleagues from the question for privacy)

Using "ConfiForms Rules for Field Definition" macro with "Validate" as an action is a right thing to do

And the key is in the condition you put. You need to define a condition that "fails" the validation

Consider the following example (same approach works with ANY multi-value field - checkbox group, for example):

<http://recordit.co/tsh9CiUtog>

Screenshots from the editor:

![validate-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/178321i9C995C348DCD97C3/image-size/large?v=v2&px=999 "validate-1.png")![validate-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/178322i8242F47753CFCC26/image-size/large?v=v2&px=999 "validate-2.png")![validate-3.png](https://community.atlassian.com/t5/image/serverpage/image-id/178323i2A4957D3EA0B04C8/image-dimensions/393x597?v=v2 "validate-3.png")

Storage format:

```
<ac:structured-macro ac:macro-id="2d62eb02-e304-4242-9e61-6fd116615796" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">myform</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="e25dc1b6-a685-4c7f-9af7-241bbe42402a" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="fc7af8dd-9789-44ac-9485-ad659f13845e" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">options</ac:parameter>
<ac:parameter ac:name="fieldLabel">My options</ac:parameter>
<ac:parameter ac:name="values">false[1=one|2=two|3=three|4=four|5=five|]</ac:parameter>
<ac:parameter ac:name="type">multi</ac:parameter>
</ac:structured-macro>?<ac:structured-macro ac:macro-id="f506f458-c646-4396-97f8-edd81d239dd5" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">options.asLength:&gt;3</ac:parameter>
<ac:parameter ac:name="fieldName">You are allowed to choose up to 3 options</ac:parameter>
<ac:parameter ac:name="action">Validation rule</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
```

Hope it helps

Alex


Tags: confiforms