Dmiller35 Posted April 3 Share Posted April 3 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? Quote Link to comment Share on other sites More sharing options...
lasdoog Posted April 3 Share Posted April 3 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> Quote Link to comment Share on other sites More sharing options...
Dmiller35 Posted April 3 Author Share Posted April 3 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. Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted April 3 Share Posted April 3 Your syntax isn't quite right. Try this instead: return '<b>' + emailarray[0] + '</b>' + "@" + emailarray[1]; Quote Link to comment Share on other sites More sharing options...
Dmiller35 Posted April 4 Author Share Posted April 4 Ah, okay. That's what I tried originally but I had left out the plus symbols between the tags. That worked great, thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.