Jump to content

2 rules for one field


Recommended Posts

Good afternoon -

I require two rules to be applied to only one field. Field is "Title".


One rule I have forces it to UPPER CASE.

The 2nd Rule I have changes a "2" to a SuperScript "2".



How do I combine those two rules to force it to output the "Title" field with both rules applied?

Link to comment
Share on other sites

If the second rule is only for a specific case (superscripting a '2'), you could just use a basic replace() after converting the value to uppercase:

return ToUpper(Field("Title")).replace("AA2","AA<superscript>2</superscript>");

If you wanted to superscript any digit(s), you would use a regular expression like so:

return ToUpper(Field("Title")).replace(/(\d+)/g,"<superscript>$1</superscript>");

Link to comment
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...