traba5058 Posted March 30, 2016 Share Posted March 30, 2016 Please help. I'm programming a business card template and the customer uses 2 colors for the name. First Letter is PANTONE 2717 C and all other letters are Pantone 659 C. Will someone help me write a javascript rule for this? Thanks! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted March 30, 2016 Share Posted March 30, 2016 var name = TaggedDataField("name"); return '<color name="PANTONE 2717 C">' + name[0] + '<color name="Pantone 659 C">' + name.substr(1); Quote Link to comment Share on other sites More sharing options...
traba5058 Posted March 30, 2016 Author Share Posted March 30, 2016 Thanks so much! That worked perfectly. Can you help me with one more thing? They also want the case for this field to be All Caps. Will you show me how to incorporate that in this rule? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted March 30, 2016 Share Posted March 30, 2016 Thanks so much! That worked perfectly. Can you help me with one more thing? They also want the case for this field to be All Caps. Will you show me how to incorporate that in this rule? var name = ToUpper(TaggedDataField("name")); return '<color name="PANTONE 2717 C">' + name[0] + '<color name="Pantone 659 C">' + name.substr(1); Quote Link to comment Share on other sites More sharing options...
traba5058 Posted March 30, 2016 Author Share Posted March 30, 2016 Thanks so much for all of your help & the quick response! It works perfectly. 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.