Hello I am creating a confiform where user can put IDs. I put comma separate to put those IDs.But how can set a limit that user can’t put more then 5 IDs on the form?please reply
Hi @Mr Ali and welcome to this community
Are you using a text field to enter IDs? Not something like a "multi-label" field in ConfiForms, no?
If a text field then you can set up a conditional validation rule, something like this
Demo: http://recordit.co/zjfdGrSm0b
Example storage format:
<ac:structured-macro ac:macro-id="43cb5d70-d629-40b8-9046-c3dd31f69854" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="a5e447e7-e1a8-4f0c-95e7-52e959a2bd4d" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="hideMetadata">true</ac:parameter>
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="864de13f-9e71-400b-bcf0-5531e89fa067" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">IDS</ac:parameter>
<ac:parameter ac:name="fieldLabel">Enter IDS</ac:parameter>
<ac:parameter ac:name="fieldDescription">comma separated, but not more than 5</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="ea9621a5-8c59-4d06-bc75-d2886b5f17ab" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">IDS.split(,).asCount:>5</ac:parameter>
<ac:parameter ac:name="fieldName">You are not allowed to enter more than 5 IDs</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
Hi Alex,
I followed your suggested steps,but not working
I added two Macro
first one is Confiforms Form field Defination
Here I put
Field name IDS
Field label IDS
Field Type Text
Field description (optional) comma separated, but not more than 5
on the 2nd Confiforms Rules for Field Definition
Field name You are not allowed to enter more than 5 IDs
Condition IDS.split(,).asCount:>5
Action to execute * Validation rule
Could you please check what need to change here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The condition is
IDS.split(,).asCount:>5
(in the storage format it gets escaped to be XML friendly)
but in the demo I have recorded for you it is not escaped
Have you checked the screencast I have recorded for you?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Really not sure I can help you here - provided a video, a storage format for the configuration for you to easy import...
Showed it works...
May be someone else can help better
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.