I've cleaned up your code a bit. Make sure you have your return tagged text 
checkbox turned on in your rule. And keep in mind that double quotes within 
another set of double quotes should be replaced to single quotes on the outter 
most ends. You shouldn't need the span tags either normally, but they shouldn't 
hurt. See if this helps:

if (Field("fontCompany") == "Arial")
{
   return "<span>" + '<f name="Arial">' + Field("CompanyName") + "</f></span>";
}
else if (Field("fontCompany") == "Arial Bold")
{
   return "<span>" + '<f name="Arial Bold">' + Field("CompanyName") + 
"</f></span>";
}
else
   return Field("CompanyName");


I added one else if statement so you could see one example. I also added the 
default else statement at the end so that it will return the company name in 
your default font in the frame. Just as a side note, sometimes the name of the 
font used in the f name tag is not what it shows up as in the dropdown. If the 
font looks incorrect, you could try checking the fonts.ini file that is 
installed with your software to see what it calls the name (ex. sometimes Arial 
Bold might be stored as Arial-Bold).

-Lauren

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, August 31, 2007 10:08 AM
To: FusionPro Users Forum
Subject: [fusionpro] Trying to change font of variable using java, need
help


Hey there,
I have a bunch of templates that I am creating where i need to have
certain variables change font face with user selection in a drop down menu
with browse. So when the user selects Arial in the dropdown (named
fontCompany), that the line below(named Company Name) will change to arial
font. I have been using UI rules, but it is very time consuming to do for
each template since there are multiple changes. Any help in getting this
started in javascript would be great. I am looking for an else if type
statement as i am using Arial, Arial Italic and Bold, and 6 other fonts.

if (Field("fontCompany") != String("Arial"))
{
   return "<span>" +"<f name= \"arial\">"+Field("CompanyName")+"</f>";"</span>";
}

return "";

is this right? any help would be great? am I missing something?

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 
Calling all FP Web Users!

Do you have a question or lots of knowledge to share about FusionPro Web?

If so, join our Printable Web to Print Users' Forum today!

Send email to [EMAIL PROTECTED] to find out how! 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-


--
Users of FusionPro Desktop have unlimited free email support. Contact Printable 
Support at [EMAIL PROTECTED] 
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm

--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--


--
Note:  All e-mail sent to or from this address will be received or otherwise 
recorded by the e-mail recipients of this forum. It is subject to archival, 
monitoring or review by, and/or disclosure to someone other than the recipient. 
Our privacy policy is posted on www.printplanet.com
--


+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Calling all FP Web Users!

Do you have a question or lots of knowledge to share about FusionPro Web?

If so, join our Printable Web to Print Users' Forum today!

Send email to [EMAIL PROTECTED] to find out how!
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-


--
Users of FusionPro Desktop have unlimited free email support. Contact Printable 
Support at [EMAIL PROTECTED]
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm

--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--


--
Note:  All e-mail sent to or from this address will be received or otherwise 
recorded by the e-mail recipients of this forum. It is subject to archival, 
monitoring or review by, and/or disclosure to someone other than the recipient. 
Our privacy policy is posted on www.printplanet.com
--

Reply via email to