Jump to content

hiding labels that are different fonts than variable text

Recommended Posts

Using FP v7.

I have a line as follows on a business card:


Email: jsmith@mail.com http://www.mail.com


I need the label "Email:" to dissappear if there is no email entered. I know how to do it if the label and the following text are the same font weight/type/etc, but in this case, the label is a different font from the text that follows.


Any tips on how I can do this? I couldn't find anything in the javascript code that would solve this :(

Link to comment
Share on other sites

The span tag is handy for stuff like this. Check out the post here: http://forums.pti.com/showthread.php?p=1819


Here's an example of one way this could be done using the span tag:

var emailline = "";

if (Field("Email").length > 0)
   emailline = '<span font="fontname1" bold="true">' + "Email: " + '</span><span font="fontname2" bold="false">' + Field("Email") + '</span>' + " ";

return emailline + '<span font="fontname3">' + "www.mail.com" + '</span>';

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