BAndreas Posted March 23, 2010 Share Posted March 23, 2010 I have a business card template where a user can select a black or white background, and the copy is returned in the opposite. Here is the code I used. It validates and works correctly on the desktop, but not when uploaded. (White appears dark grey on top of Black) The white is also within my template color manager. var modTextBlack = "<f name=\"" + Field("Font") + "\">" + "<color name=\"black" + "\">" + Field("Fname") + "</color>" + "</f>"; var modTextWhite = "<f name=\"" + Field("Font") + "\">" + "<color name=\"white" + "\">" + Field("Fname") + "</color>" + "</f>"; if (Field("Color") == "black") return modTextWhite; else return modTextBlack; Appreciate the help on this. Link to comment Share on other sites More sharing options...
esmith Posted March 23, 2010 Share Posted March 23, 2010 The code looks right to me too. I notice in your color tags that your color name is in all lowercase, but in (my) FP color palette, the names begin with a capital letter. Could that be an issue? Link to comment Share on other sites More sharing options...
BAndreas Posted March 23, 2010 Author Share Posted March 23, 2010 Hi esmith. Trying to expand on the code you provided in a past thread. (Mucho thanks!) Unfortunately, I get the same result with the capitalization. (Dark gray type on a Black background.) Anyway, works great on the desktop. Link to comment Share on other sites More sharing options...
Dan Korn Posted March 23, 2010 Share Posted March 23, 2010 Color names in FusionPro (in tagged markup) are not case-sensitive. That is, "Black" is the same as "black" and "BLACK." However, if you write some JavaScript logic which does a comparison against a color name (such as in your example), then that comparison may very well be case-sensitive. So you may want to do something like this instead: if (ToLower(Field("Color")) == "black")Beyond that, if your output is different in Desktop than in MarcomCentral, I would suggest asking about it on the MarcomCentral forum. Link to comment Share on other sites More sharing options...
BAndreas Posted March 23, 2010 Author Share Posted March 23, 2010 ^^^ No such luck. Link to comment Share on other sites More sharing options...
Dan Korn Posted March 23, 2010 Share Posted March 23, 2010 Like I said, if it's working differently under MarcomCentral, you should ask on that forum. You may also want to try making a copy of the rule with the "Treat returned strings as tagged text" box UNchecked and output that to a separate frame as a means of debugging after uploading. Maybe dump the field value as well; it might not be what you think it is based on the entry in the web form. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.