JCrocker Posted April 24, 2012 Share Posted April 24, 2012 I know this is simple but I cant get it to work. Basically If field Phone1 has a # in it I need it to return the formatted phone number rule, which I have already set up, and the word "Work" if field Phone1 is empty it needs to return nothing. Also Have a mobile1 field, If mobile1 field has a # I need it to return The formatted number, already setup that rule, plus the text "mobile", if its empty it need to return nothing as well. Can Anyone please help me out. Thanks Jeremy Link to comment Share on other sites More sharing options...
dleahy Posted April 24, 2012 Share Posted April 24, 2012 Can't you suppress the field if containing empty variables right in the Paragraph Formatting tab in Fusion Pro? http://forums.pti.com/attachment.php?attachmentid=624&stc=1&d=1335296129 Link to comment Share on other sites More sharing options...
Dan Korn Posted April 24, 2012 Share Posted April 24, 2012 If each number is on its own line, you don't need another rule. You can simply type "Work" and insert the variable for the phone formatting rule in the Text Editor, then click the Paragraph button, and select "Suppress if Containing Empty Variables." Do the same on another line for the mobile number. EDIT: Just like in Dan Leahy's screenshot above. Thanks, Dan! Link to comment Share on other sites More sharing options...
ThomasLewis Posted April 24, 2012 Share Posted April 24, 2012 Easiest way to do it in JavaScript is set them up as variables then prepend the prefix to the number if there is something there. Otherwise it equals and empty string. var ph1 = ""; if (Field("Phone1").length > 0) ph1 = "Work: " + Field("Phone1"); Or easier yet, use the built in suppress (see attached). Link to comment Share on other sites More sharing options...
dleahy Posted April 24, 2012 Share Posted April 24, 2012 Screenshots all over da place! Link to comment Share on other sites More sharing options...
ThomasLewis Posted April 24, 2012 Share Posted April 24, 2012 Meh, you two snipered me Link to comment Share on other sites More sharing options...
JCrocker Posted April 24, 2012 Author Share Posted April 24, 2012 Thanks guys! Yea Dan thats how I had tried to go about it before but I wasnt having any luck getting "work" and "mobile" to supress along with the variable. Working now tho. Thx Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.