I'm trying to combine 2 fields and add an & symbol in between, but only if there is text entered in the second field. This way I wouldn't end up with "Seller Names: Joe Smith &" if there was only one seller name.
Here is my current script, this of course is automatically adding the " & " all the time.
// Get the field values, as strings
var s1 = getField("s1").valueAsString;
var s2 = getField("s2").valueAsString;
// Combine values, separated by &
event.value = s1 + " & " + s2;
Replace the last line with:
event.value = s1;
if (s2!="") event.value+= " & " + s2;
I need to use forums more.. Thanks!