Text wrapping embedded data | XM Community
Skip to main content
Question

Text wrapping embedded data


Forum|alt.badge.img+1

I am asking survey respondents to confirm ZIP code data that we previously collected, and am using embedded data to have them confirm. The issue is that some of the data contains up to 994 characters, so the embedded data runs off the side of the page, making it hard to read and continue the survey. Is there a way to use text wrapping to avoid this issue with the embedded field? I have tried containing it in a fixed width table and fiddling with the source code and settings, with no luck. Issue shown in picture. 

 

 

 

3 replies

Forum|alt.badge.img+6
  • QPN Level 2 ●●
  • 40 replies
  • January 2, 2025

Hi,

Try using CSS :

textarea {
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    max-height: 200px; /* Limit height if the content is too long */
    overflow-y: auto; /* Add vertical scrollbar if the content exceeds the max height */
}

 


Forum|alt.badge.img+1
  • Author
  • 2 replies
  • January 3, 2025

@resh_kr Thanks for the suggestion. I entered that In the custom CSS in the style section under look and feel, but that did not resolve my issue. Is there another way to do this without having to manually split it into separate embedded fields? 

 

Is my issue that the data is only separated by a ; and not spaces? 

 

My code for the question itself is:

<div>Previously, you told us that you served the following ZIP codes:</div>

<div>&nbsp;</div>

<table style="background-color:#ffffff; fixed; width:750px; border-collapse: collapse; color:black" cellspacing="1" cellpadding="5" border="0">
</table>

<table style="fixed; width:750px;" id="table1" cellspacing="1" cellpadding="1" border="1" align="left">
    <tbody>
        <tr>
            <td>${e://Field/Zips%201}&nbsp;<br>
            ${e://Field/Zips%202}<br>
            ${e://Field/Zips%203}<br>
            ${e://Field/Zips%204}<br>
            ${e://Field/Zips%205}<br>
            ${e://Field/Zips%206}</td>
        </tr>
    </tbody>
</table>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div><strong>Is that still correct? </strong></div>

<div>&nbsp;</div>
 


Forum|alt.badge.img+1
  • Author
  • 2 replies
  • January 3, 2025

Found a solution after playing around with my data and the code @resh_kr sent. 

 

Needed to make sure zips were separated by a semicolon AND a space. 

 

Code:

textarea {
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
    max-height: 200px; /* Limit height if the content is too long */
    overflow-y: auto; /* Add vertical scrollbar if the content exceeds the max height */
}


Leave a Reply