Check whether a string contains number or not in Advanced PDF template

To check whether a string contain numbers or not , refer the following template code sample

<table style="width:100%;">
<tr>
<td colspan="6" class="tableup" align="left" style="padding-left:-22px;">
               <#if record.salesrep?has_content>
               <#assign empid=record.salesrep>
               <#assign len = empid?length>
               <#assign empid2 = empid?replace("\\D+", "", "r")>
               
               <#if empid2?has_content>
  
                <!-- It contains characters only, no number on it-->
               <#else>
                <!-- It contains number-->
               </#if>
               
               </#if>
</td>
</tr>
</table>

Leave a comment

Your email address will not be published. Required fields are marked *