Jump to content

Display List-String as list not comma-separated


Recommended Posts

I'm not sure where you need this for since you've already mentioned it's the same as the Display Only one, however, this can be done through JavaScript

 

First, create an HTML block, Disable HTML Editor, and add this

<ul id="listing">
</ul>

This is where the values will be listed

 

Next on the Footer

<script>

//CHANGE THE FIELD
var listString= "[@field:ListNUm]";




var mainList = document.getElementById("listing");
var arrayList = listString.split(',');

for(var i=0;i<arrayList.length;i++){
         var elem = document.createElement("li");
         elem.value=arrayList[i];
         elem.innerHTML=arrayList[i];


         mainList.appendChild(elem);
    }
</script>

Change the field in the var listString using the FIELD PICKER, make sure you're using String, if it's a List-number DataType, still use String.

 

image.png.36c0cd8581ef07f3deb185eb833a4a88.png

 

This is how it looks, ListNUm is the Display Only Field, Just the Field is an HTML Block where I inserted the ListNUm field, Listed is an HTML block using this method.

NOTE: What this does is separate the value between commas, so, if you have commas in your List-String choices, this will not work for you.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...