AnsweredAssumed Answered

Passing arguments to javascript for field validation

Question asked by wurstgelee on Sep 6, 2012
Latest reply on Sep 7, 2012 by wurstgelee
I´m trying to do some field validation in a workflow form.

As far as I understand http://docs.alfresco.com/4.0/topic/com.alfresco.enterprise.doc/concepts/forms-intro.html?resultof=%22%63%6f%6e%73%74%72%61%69%6e%74%2d%68%61%6e%64%6c%65%72%22%20, it is possible to pass arguments (@param args) to a validation handler (the javascript function).

My validation handler implementation for the field validation currently looks like this:

<field id="aiwf:itemDescription2" set="InvestItems" label="" mandatory="true">
            <control template="/custom-textfield.ftl" />
            <constraint-handlers>
              <constraint type="MANDATORY" validation-handler="Alfresco.forms.validation.validateStringLength" event="keyup" silent="false" message="test1">
              </constraint>
            </constraint-handlers>
</field>

I would like to pass the valid min and max string length to the validateStringLength function. How can I archieve this? Or isn´t this possible?

Please help me! ;)

Outcomes