AnsweredAssumed Answered

Validation of range with numberrange.ftl

Question asked by mcasanket on Dec 29, 2011
Latest reply on Mar 25, 2014 by darkredd
Hello Everyone,
In one requirement I am using numberrange.ftl file, to search files by size. I have configured my code in share-config.xml and It is showing me the two text boxes for minimum and maximum size.
   I want to put some client validation like min size should be less than max size, Accepts only numbers no special characters and text.
My code in share-config.xml is as below.
<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>

Please help!
Thanking you!

Outcomes