Fabian Posted January 23, 2009 Share Posted January 23, 2009 hello, id like write a rule that returns literal text (in this case a comma). for example: if Field"FirstName" and/or Field"LastName" have a value, return a "," after the last field with a value. so for instance if Field"FirstName" was Joe and Field"LastName" was Sample; return Joe Sample, or if Field"FirstName" was Joe and Field"LastName" had no value; return Joe, or if Field"FirstName" had no value and Field"LastName" was Sample; return Sample, and if Field"FirstName" and Field"LastName" have no value; return nothing im not too sure on how to write the javascriptin for this, so id appreciate anyones help Link to comment Share on other sites More sharing options...
Brian F. Posted January 23, 2009 Share Posted January 23, 2009 I think this should do it: Create an empty text rule, give it a name and paste the following (adjusting your field names of course). if (Field("FirstName")||Field("LastName")) return ","; else return ""; This is saying if either field has a value of any kind return the ",". Otherwise return nothing. You may need to check the "return tagged strings as text" checkbox in the rule editor. Link to comment Share on other sites More sharing options...
Fabian Posted January 24, 2009 Author Share Posted January 24, 2009 thanks Brian! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.