# How to set Text Input to text wrap

**URL:** <https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [July 8, 2017, 9:13pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726 "2017-07-08T21:13:39Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slurpee](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@Slurpee](https://forum.inductiveautomation.com/u/Slurpee)\
**Post date:** [July 8, 2017, 9:13pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/1 "2017-07-08T21:13:39Z")

</div>

I'm creating a text input in a Form where sometimes the input will get too long.  
How can I set the text input to wrap?

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6addffae52f740c082f1e83770d3a8a366c8df75.png)

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [July 9, 2017, 8:16am UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/2 "2017-07-09T08:16:45Z")

</div>

Are you using a “Text Field” or a “Text Area”?

When you use a text area, there’s a “Line Wrap” option, under the “Behaviour” category. That should do exactly what you want.

be sure to make the text area large enough to get a decent scrollbar (at least 3 lines to give room to both arrow buttons and a small scroll bar itself).

Also note that you can set the default number of rows and columns of the text area. If this default number is bigger than the actual size of the text area, scrollbars will always be shown. If you want to hide scrollbars by default, you may need to make this number smaller.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [July 9, 2017, 11:17pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/3 "2017-07-09T23:17:35Z")

</div>

Ignition really should add Line Wrap to the Text Field component though.  
You can wrap your text in `"<HTML></HTML>"` which will give you line wrapping functionality. Its very irritating to do this for everything though.I guess we could always create our own template, but it seems like something that should be inherently supported.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 10, 2017, 3:10pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/4 "2017-07-10T15:10:08Z")

</div>

The entire point of the Text Area component is to add support for multiple lines. The Swing Text Field component ([JTextField](https://docs.oracle.com/javase/7/docs/api/javax/swing/JTextField.html)) expressly states:

> `JTextField` is a lightweight component that allows the editing of a single line of text.

---

<div class="post-metadata">

**Author:** ![Slurpee](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@Slurpee](https://forum.inductiveautomation.com/u/Slurpee)\
**Post date:** [July 10, 2017, 3:47pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/5 "2017-07-10T15:47:32Z")

</div>

Thanks for your reply.  
I want to use Text Field so the scroll bar won’t show up.

Since it seems that I can’t do it in Text Field, I have used Text Area instead, and set the rows to 2 so the scroll bar won’t show up.

---

<div class="post-metadata">

**Author:** ![casey.myers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/casey.myers/32/80632_2.png) [@casey.myers](https://forum.inductiveautomation.com/u/casey.myers)\
**Post date:** [July 11, 2017, 2:45pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/6 "2017-07-11T14:45:38Z")

</div>

Have you tried placing just a \< html \> (minus the spaces) tag in front of the text that appears in the field? I have used that before when I wanted to make text wrap.

Example: \< html \>This is the text in my text field

---

<div class="post-metadata">

**Author:** ![Slurpee](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@Slurpee](https://forum.inductiveautomation.com/u/Slurpee)\
**Post date:** [July 11, 2017, 3:23pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/7 "2017-07-11T15:23:22Z")

</div>

what do you mean @casey.myers,  
I want to use this for text input for a Form to be submitted and written in a database.  
do you mean every time they key in something they need to type ?  
where should I put the ?

---

<div class="post-metadata">

**Author:** ![Zachary\_Sobie](https://avatars.discourse-cdn.com/v4/letter/z/ad7895/32.png) [@Zachary\_Sobie](https://forum.inductiveautomation.com/u/Zachary_Sobie)\
**Post date:** [November 4, 2024, 9:57pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/8 "2024-11-04T21:57:59Z")

</div>

I have tried and it does not wrap my text.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [November 4, 2024, 10:49pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/9 "2024-11-04T22:49:02Z")

</div>

Since this topic is from 2017, it's probably wise to make sure you are using Vision, not Perspective. This topic was Vision.

---

<div class="post-metadata">

**Author:** ![Zachary\_Sobie](https://avatars.discourse-cdn.com/v4/letter/z/ad7895/32.png) [@Zachary\_Sobie](https://forum.inductiveautomation.com/u/Zachary_Sobie)\
**Post date:** [November 5, 2024, 12:28pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/10 "2024-11-05T12:28:37Z")

</div>

Thanks for the reply. I am using Vision. I saw in another post that you could use   
 for line breaks which would be ideal, but sadly that is not working either 🙁

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [November 5, 2024, 12:59pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/11 "2024-11-05T12:59:04Z")

</div>

Show what you have tried, maybe screenshots.

---

<div class="post-metadata">

**Author:** ![Zachary\_Sobie](https://avatars.discourse-cdn.com/v4/letter/z/ad7895/32.png) [@Zachary\_Sobie](https://forum.inductiveautomation.com/u/Zachary_Sobie)\
**Post date:** [November 5, 2024, 1:17pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/12 "2024-11-05T13:17:34Z")

</div>

Zachary D Sobie | Controls Engineer

> **(attachments)**
>
> ![Line Break.png](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/2373430c998043591035583504258e76c4a5c3a9.png)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [November 5, 2024, 1:19pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/13 "2024-11-05T13:19:27Z")

</div>

A text field doesn't work that way. To get line breaks you must use a text area component. It can be styled to look exactly like a text field.

---

<div class="post-metadata">

**Author:** ![Zachary\_Sobie](https://avatars.discourse-cdn.com/v4/letter/z/ad7895/32.png) [@Zachary\_Sobie](https://forum.inductiveautomation.com/u/Zachary_Sobie)\
**Post date:** [November 5, 2024, 1:20pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/14 "2024-11-05T13:20:12Z")

</div>

I tried that, but it's editable by the user and I do not want that

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [November 5, 2024, 1:22pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/15 "2024-11-05T13:22:53Z")

</div>

If you don't want it editable, there are plenty of ways around that. For example, you could use a label component, and if it needs to look like a text field, fill the background and give it a border.

---

<div class="post-metadata">

**Author:** ![Zachary\_Sobie](https://avatars.discourse-cdn.com/v4/letter/z/ad7895/32.png) [@Zachary\_Sobie](https://forum.inductiveautomation.com/u/Zachary_Sobie)\
**Post date:** [November 5, 2024, 1:26pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/16 "2024-11-05T13:26:33Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/b/fb4d1895dad35f7fab9f3bd618e38d26ad27b9b5.png)

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [November 5, 2024, 1:30pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/17 "2024-11-05T13:30:19Z")

</div>

Put `<html>` at the beginning of the string:

```python
<html>INLINE<br>RINSE

```

You can also use to center align the text:

```python
<html><center>INLINE<br>RINSE

```

---

<div class="post-metadata">

**Author:** ![Zachary\_Sobie](https://avatars.discourse-cdn.com/v4/letter/z/ad7895/32.png) [@Zachary\_Sobie](https://forum.inductiveautomation.com/u/Zachary_Sobie)\
**Post date:** [November 5, 2024, 1:45pm UTC](https://forum.inductiveautomation.com/t/how-to-set-text-input-to-text-wrap/14726/18 "2024-11-05T13:45:15Z")

</div>

That worked, thanks!
