Jump to content

Changing Font or Color for part of a field.

Recommended Posts

I have some business cards that require either a different font or a different color for a portion of a field.

For example, the email address has the name in Eurostile Bold and the domain Eurostile Regular.

I can't seem to split the email address and apply the Bold tag.

Here is the code I'm currently trying to use:

var emailarray = Field("Email Address").split("@");
return '<b>emailarray[0]</b>' + "@" + emailarray[1];

This would work in splitting the address but it doesn't work once I add the bold tag.

I've also got phone number fields where the area code needs to be in a pantone color.  I haven't tried that one yet but felt like I was going to run into the same problem.

Anyone have any ideas?

Link to comment
Share on other sites

You could try calling the actual font name on your array element:


'<f name="Eurostile Bold">emailarray[0]</f name>'

for color something like:

'<color name="PANTONE 300">'emailarray[0]</color name>

Link to comment
Share on other sites

Sorry, I just realized I wasn't super specific with the issue I'm having in the first post.

My issue is that when I use the markup tags, the result is "emailarray[0]@domain.com" instead of displaying the correct name. If I take the markup tags off, it displays everything correctly, just not in bold. I think the tag is making it so that it's not seeing the variable name correctly.


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...