As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<config evaluator="string-compare" condition="Advhttp://d1.openx.org/ck.php?n=aff1db45&cb=1497122073ancedSearch"> <advanced-search> <forms> <form labelId="search.form.label.cm_content" descriptionId="search.form.desc.cm_content">cm:content</form> <form labelId="search.form.label.cm_folder" descriptionId="search.form.desc.cm_folder">cm:folder</form> [b]<form labelId="Search By Size" descriptionId="Search by size">cm:content</form>[/b] <!– Mine –> </forms> </advanced-search> </config> <config evaluator="model-type" condition="cm:content"> <forms> <form id="search"> <field-visibility> <!– <show id="kb:ilLevelOne" /> –> <show id="mimetype" /> <show id="cm:categories" force="true"/> <show id="size" /> </field-visibility> <appearance> <field id="mimetype" label="Document Type"> <control template="/org/alfresco/components/form/controls/mimetype.ftl" /> </field> <field id="cm:categories" label="Document Category"> <control> <control-param name="compactMode">true</control-param> </control> </field> <!– Number Range for file range.–> <field id="size" label="Document Size"> <control template="/org/alfresco/components/form/controls/numberrange.ftl" /> </field> </appearance> </form> </forms> </config>
Alfresco.forms.validation.checkNumber = function checkNumber(field, args, event, form, silent, message) { var ok = (field.value=="") || field.value.match("^\\d{4}\\/\\d{4}$"); var valid = ok != null && ok; if (!valid) { YAHOO.util.Dom.setStyle(field.id, "border", "2px solid red"); } else { YAHOO.util.Dom.setStyle(field.id, "border", ""); } // Inform the user if invalid if (!valid && !silent && form) { var msg = "The number must match the pattern 1234/5678."; form.addError(form.getFieldLabel(field.id) + " " + msg, field); } return valid; };
<config> <forms> <dependencies> <js src="/js/custom-form-validation.js" /> </dependencies> </forms> </config>
<field id="custom:customNumberField"> <constraint-handlers> <constraint type="MANDATORY" validation-handler="Alfresco.forms.validation.checkNumber" event="keyup" /> </constraint-handlers> </field>
<field id="bpm:workflowDueDate" label-id="workflow.field.dueDate" set="info" mandatory="true"> <control template="/org/alfresco/components/form/controls/date.ftl"> <control-param name="showTime">false</control-param> <control-param name="submitTime">false</control-param> </control> <control template="/org/alfresco/components/form/controls/datevalidation.ftl"></control> <constraint-handlers> <constraint type="MANDATORY" validation-handler="Alfresco.forms.validation.validateDate" event="keyup" /> </constraint-handlers> </field>
<div class="form-field"> <#if form.mode == "view"> <div class="viewmode-field"> <span class="viewmode-label">${field.label?html}:</span> <span class="viewmode-value">${field.value?html}</span> </div> <#else> <label for="${fieldHtmlId}">${field.label?html}:<#if field.mandatory><span class="mandatory-indicator">*</span></#if></label> <input id="${fieldHtmlId}" type="text" name="${field.name}" value="${field.value}" style="background-color: green; color: white; width: 700px;" <#if field.disabled>disabled="true"</#if> /> </#if> </div>