Brandie Posted February 1 Share Posted February 1 Can anyone help me add a hard return before and after this line? I've tried \n and \r and <br> to no avail. I'm a graphic designer, not a coder - halp! haha if (Field("Program2") == "") return ""; else return //line break HERE Field("Program2abbr") + ' Student Sponsorship of Up to ' + val //line break HERE ; } Quote Link to comment Share on other sites More sharing options...
Alex Marshall Posted February 2 Share Posted February 2 Not sure if this is what you are looking for. Make sure to check the box for "Treat Return Strings As Tagged Text" if(Field("Program2") == "") { return "" } else { return '<br>' + Field("Program2abbr") + ' ' + "Student Sponsorship of Up to" + ' ' + Field("val")+ '<br>'; } Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 2 Share Posted February 2 Newlines should work, but you need to include them in a literal string, between quotes, like so: if (Field("Program2") == "") return ""; return "\n" + Field("Program2abbr") + ' Student Sponsorship of Up to ' + val + "\n"; You can also use <br> tags as Alex suggests, but in that case, I would recommend calling TaggedDataField instead of Field, in case the data contains "special" characters such as ampersands, like so: if (Field("Program2") == "") return "" return '<br>' + TaggedDataField("Program2abbr") + ' ' + "Student Sponsorship of Up to" + ' ' + val + '<br>'; Though the first version seems simpler. Note also that you don't need the "else" statement after the "return". Quote Link to comment Share on other sites More sharing options...
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.