7 Replies Latest reply on Feb 23, 2015 3:13 AM by PeteEaglesfield

    How to prevent Text Wrapping...

    BradWieland

      Title

      How to prevent Text Wrapping...

      Post

           Sometimes my client enters text that is too long into a SKU field, and the text wraps to a 2nd line and then is not visible on the Layout. How do I prevent text from wrapping in a field? (I don't want to set a maximum number of characters.)

        • 1. Re: How to prevent Text Wrapping...
          philmodjunk

               Yet that may be your only and imperfect way to do this short of some real complexity. But keep in mind that if the text didn't wrap and you didn't limit the input to what fits in the field, the next would still not be fully visible.

               It is possible to use a script to check and see if the text in a given field wraps to more than one line, but it gets pretty complicated. You have to add a special layout where the field is sized to two rows of text tall and set to slide up in sliding and visibility. Then your script switches to this layout, enters preview mode and uses GetLayoutObjectAttribute with the height parameter to see if the height is that of a one row field or larger.

          • 2. Re: How to prevent Text Wrapping...
            JimMac

                 Make your font size smaller for that field, add a scroll bar and perhaps a tool tip.  We spend too much time on "newbie" training or outguessing sometimes.

                 Jim...

            • 3. Re: How to prevent Text Wrapping...
              BradWieland

                   Phil & Jim,

                   Would it be possible to set up a conditional format where the field turns to a different color if the text wraps? As a warning?

              • 4. Re: How to prevent Text Wrapping...
                Sorbsbuster

                     "Would it be possible to set up a conditional format where the field turns to a different color if the text wraps? As a warning?"

                     ...and/Or set the conditional format to a smaller font size if the character count exceeds a certain number.

                • 5. Re: How to prevent Text Wrapping...
                  philmodjunk

                       I've been able to use conditional formatting to reduce font size when the number of characters exceeds a specified length, but this is not perfect as iiii uses far fewer pixels than WWWW.

                       The only 100% effective method that I know is a script using the methods that I outlined earlier. But If you add a scroll bar, I believe that the appearance of the scroll bar changes when there is text to be seen by scrolling the scroll bar.

                  • 6. Re: How to prevent Text Wrapping...
                    JimMac

                         Please note that the User can type an "errant" carriage return and make the text disappear too.  

                         @Phil's pixel spacing....Change fonts to a "mono-spaced" font such as Monaco, which put "i" and "W" in same space.

                         A newbie always "panics" one time until he learns about entending text field behavior.  There was a  "brianiac" who had a remarkable script which intercepted each key stroke, checked it, and put in a password "•" in this formum.  You might search for password in this forum if you are still interested.

                         Jim...

                    • 7. Re: How to prevent Text Wrapping...
                      PeteEaglesfield

                      I've found a better way to do this...

                      Case (
                          Length ( your_field ) > 20;
                          Left ( your_field ; 12 ) & "..." & Right ( your_field ; 5 );
                          your_field
                          )

                      So, if your field contains "this is a very long field", it will be truncated to "this is a ve...field".  You can then add a tooltip to allow you to see the whole field contents. 

                      Of course, you may need to add a secondary field for this purpose, depending on what you're displaying, such as field_displayed.