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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...