apalmer Posted October 28, 2011 Share Posted October 28, 2011 Hi all, I need a little help tweaking a javascript rule I'm using. I have a 188 page document using a pdf background. The users select which pages they want to print and the rule calls the correct background page. Here's the rule: var t,i; var retstring = ""; var y = Resource("Backgrounds"); for (i=1;i<=189;i++) { if(ToTitleCase(Field(FormatNumber("000", i)+"Item"))=="Yes") { t = new FPRepeatableComponent("T1"); y.pagenumber=i; t.AddGraphic("Image",y); t.AddTextVar("Price", Field(FormatNumber("000", i)+"Price"), false); retstring += t; } } return retstring; What I'm trying to do now is add an additional option so the user can make one selection (PRINT ALL) and have all pages print. Any advise on how to tweak the above rule to include this option or creating a new rule would be awesome. Thanks in advance. Angie Link to comment Share on other sites More sharing options...
Dan Korn Posted October 28, 2011 Share Posted October 28, 2011 Change that "if" line to something like this: if(ToTitleCase(Field(FormatNumber("000", i)+"Item"))=="Yes" || Field("PrintAll") == "Yes") Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.