spartanberry Posted September 22, 2010 Share Posted September 22, 2010 I will prefix this by saying that I am new to FusionPro and am stumbling my way through learning javascript. I am struggling to create what I thought would be an easy rule. I need to create a rule that changes a line of text based on how many years a member has been a member. Below, I pasted my last of many tries. Any ideas? Thanks, Jeff -------------------------------------------- //change membership card line that reades "Member for..." var y=Field("Years Of Membership") if (Field("Years Of Membership")> "1") { document.write("Member for ".y );document.write(" Years") } if (Field("Years Of Membership")== "0") { document.write(" ") } if (Field("Years Of Membership")== "1") { document.write("Member for ".y );document.write(" Year") } ----------------------------------------------------------- Link to comment Share on other sites More sharing options...
DSweet Posted September 22, 2010 Share Posted September 22, 2010 Jeff, Are you trying to code this in FusionPro? It looks like you are trying web javascript commands here which are a bit different. Try this... var y= Int(Field("Years Of Membership")); if (y == 0) { return ""; } else if (y == 1) { return "Member for " + y + " Year." } else if (y > 1) { return "Member for " + y + " Years." } Hope this helps you on your way. Good Luck. . Link to comment Share on other sites More sharing options...
spartanberry Posted September 22, 2010 Author Share Posted September 22, 2010 That worked great! Thank you so much for you help. I was trying to code it in FusionPro but used some javascript code that I found online. I'm used to creating variable code in PrintShop Mail so this is an adjustment. I'm sure I'll get the hang of it in time. Thanks again Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.