jpreve Posted May 31, 2016 Posted May 31, 2016 I need help on a js rule to make the last name field plural for a variable postcard. Sample Copy: "The <Smiths> can get $25.00 Off." (s added) "The <Joneses> can get $25.00 Off." (es added) I need to add an "s" to the last name field, but if the last name ends in s, x, ch, sh, or z it needs an "es". Please Help. Sincerely, jpreve Quote
step Posted May 31, 2016 Posted May 31, 2016 var lastName = Field('LastName'); if (/(s|x|ch|z)$/i.test(lastName)) lastName += 'e'; return lastName + 's'; Quote
jpreve Posted May 31, 2016 Author Posted May 31, 2016 That worked! Thanks! I really appreciate your help!!! jpreve Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.