Jump to content

Conditionally format fields in Gallery result page

Recommended Posts

It is possible to conditionally format a field in Gallery result page?

For example, I want to display blank for an email field (or hide it) if it contains "xyz". Another example, I want to reformat phone number display from 3101234567 to 310-123-4567.

Share this post

Link to post
Share on other sites

I see. For the phone number formatting, you can use this (assuming Phone is of Data Type Integer):


<script type="text/javascript">
    document.getElementById('FIELDNAME').innerText = '[@field:Int]'.replace(/[^\d]+/g, '').replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2-$3');


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...