Support

Account

Home Forums General Issues Display check box choices as line items on Elementor

Unread

Display check box choices as line items on Elementor

  • Hi,

    I am trying to show checkbox fields on Elementor as either line break items or bullet points. I figured out the function to do it by throwing the code within an additional Elementor HTML widget. However the solution sucks because I can see the text shown as CSV first then converted to line break items. I was wondering what is the recommended practice for injecting ACF functions within Elementor.

    This is the html code in injected into page template

    <script>
        window.onload = function(){
            var list = document.getElementsByClassName('list-transform');
            for(let i = 0; i < list.length; i++){
                var listValues = list[i].innerText;
                console.log(listValues);
                list[i].innerText = '';
                list[i].innerHTML += listValues.split(",").join("<br>");
            }
        }
    </script>
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.