View Full Version : Javascript for different point sizes in the same line
Jo Gerth
April 3rd, 2009, 12:09 PM
I need a rule for an address line ie:
18191 Von Karman Avenue, Suite 500 Irvine, California 92612-7108
I need numerical values to be 6.5 pt type
I need alpha values to be 7 pt type
This will be used in a drop down field to prepopulate that text field
(address line)
Customer will be able to pick from the drop down which city
they want it:
california office
chicago office
Dan Korn
April 3rd, 2009, 01:46 PM
return "<z newsize=7>" + NormalizeEntities(Field("Address")).replace(/(\d+)/g, "<span pointsize=6.5>$1</span>");
Make sure to check "Treat returned strings as tagged text."
tobarstep
April 8th, 2009, 08:40 AM
Dan, I've seen you use the span tag in a couple rules now but I don't have mention of it anywhere in my FP TagsRef documentation. Where can I find usage instructions for this tag?
I'm using FP 6.0, but it looks like my documantation is older. Looks like it's from 5.8.
Dan Korn
April 8th, 2009, 09:39 AM
Dan, I've seen you use the span tag in a couple rules now but I don't have mention of it anywhere in my FP TagsRef documentation. Where can I find usage instructions for this tag?
Sorry about that. The <span> tag was never actually documented. I've posted a new thread about it here:
http://forums.printable.com/showthread.php?t=580
tobarstep
April 8th, 2009, 09:59 AM
Sorry about that. The <span> tag was never actually documented. I've posted a new thread about it here:
http://forums.printable.com/showthread.php?t=580
Awesome. That looks like something I can make frequent use of. Thanks for the info.
Jo Gerth
April 8th, 2009, 12:30 PM
Dan
I need to add some info for this rule. I am going to build a field called
Office Location and need a rule that will allow the customer to pick the
location in the drop down menu. The rule needs to be able to associate
the chicago office with the chicago address along with the different sizes
in type. The numbers are in 6.5 and the street, suite, city and state in 7pt type. I am not experienced in rules so can you write one out exactly and it would appear with the address 18191 Von Karman Avenue, Suite 500 Irvine, California 92612-7108. Is the forum the only place we can communicate
with you guys or are phone calls allowed and who do we contact?
Dan Korn
April 8th, 2009, 01:19 PM
I need to add some info for this rule. I am going to build a field called
Office Location and need a rule that will allow the customer to pick the
location in the drop down menu. The rule needs to be able to associate
the chicago office with the chicago address along with the different sizes
in type.
If you have a separate data file that contains the addresses for different "Office Location" values, then you'll need to use the ExternalDataFileEx object to read that in. Please refer to the section titled "How to return multiple records in the same output file" in the FusionPro Rules System Guide.
The numbers are in 6.5 and the street, suite, city and state in 7pt type. I am not experienced in rules so can you write one out exactly and it would appear with the address 18191 Von Karman Avenue, Suite 500 Irvine, California 92612-7108.
I'm not sure what you mean by "write one out exactly." The example I already posted should meet those requirements. You'll have to replace the field name I guessed upon ("Address") with the actual field name from your data, or with the result of whatever other rule returns the raw address data.
Is the forum the only place we can communicate
with you guys or are phone calls allowed and who do we contact?
This forum is intended as a way for users to communicate with and help each other. It's not intended to be simply a way to ask questions of Printable, nor is it intended to be a substitute for Support, whom you can reach here (http://www.printable.com/services-support/). We offer both training and paid consulting to assist with template-building as well.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.