February 1, 2019 at 11:03 #23698
I have a field that contains multiple entries selected by checkboxes that currently display one after the other separated by “;” and I would like to display them as a list of separate items.
Is it possible to do a character replace on the “;” for a new line feed?
I would like
Item1 Item2 Item3 Item4
February 1, 2019 at 18:39 #23700
I guess this is in DispForm? – if so, you can add something like this to your Custom JS:
var raw = getFieldValue("YourFieldName"); jQuery("#dffs_YourFieldName td.ms-formbody").html(raw.split(";").join("<br>"));
Replace “YourFieldName” with your field name.
February 1, 2019 at 20:13 #23702
Thanks, I’ll give it a go, yes it is in the display form.
February 4, 2019 at 09:46 #23715
I tried the JS but it doesn’t work, I’m guessing that it’s because of the spaces in the field name? I tried various ways of writing it including escape characters in front of the spaces, underscores instead of spaces but nothing worked.
Hopefully this is easy when you know the language, this is what I have: –
var raw = getFieldValue("Projects also affected"); jQuery("#dffs_Projects also affected td.ms-formbody").html(raw.split(";").join("<br>"));
February 4, 2019 at 17:39 #23725
You must use the FieldInternalName – look at the Fields tab in DFFS backend to find the correct name.
February 4, 2019 at 17:52 #23729
LoL, that’s the only thing I didn’t try because you usually write FeildInternalName in the code when you want us to use it, this time I though YourFieldName specifically meant not to use the FIN.
It works now thanks.
You must be logged in to reply to this topic.