A supervisor in different branch of my division asked me: to
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?
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):
Screenshots from the editor:
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:>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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.