JHester Posted February 16, 2011 Share Posted February 16, 2011 Hi folks, new to the board and new to Fusion Pro and Marcom. I am looking for a rule that will format a phone number with these attributes. O: 111.222.3333 The O would be changed out depending on the field i.e. Fax, Office, Cell, Etc. but the number formats would be consistent with the periods. Clear as mud? Help me Obi-Wan Kenobi, your my only hope. Thanks! Jason Link to comment Share on other sites More sharing options...
step Posted February 17, 2011 Share Posted February 17, 2011 var number = "1112223333"; return "O " + number.substr(0,3) + "." + number.substr(3,3) + "." + number.substr(6,4); Change the "1112223333" to whatever field your office number is referencing. Link to comment Share on other sites More sharing options...
Dan Korn Posted February 17, 2011 Share Posted February 17, 2011 You don't need to write any JavaScript at all to do this. There's a built-in Template rule called "Change phone format Rule" which does this. Select it from the "New Rule" dialog, and then select the field and the "123.456.7890" format from the drop-lists. You can create different copies of this rule, changing the names to something like "Fax number formatted," "Office number formatted, "etc. Then in the Variable Text Editor, you can simply type in the labels "O:" et al, the insert the corresponding variable for the rule, one per line, then select everything and click the Paragraph button and select "Suppress if Containing Empty Variables." Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.