# How to set focus

**URL:** <https://forum.inductiveautomation.com/t/how-to-set-focus/14445>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [June 2, 2017, 12:55pm UTC](https://forum.inductiveautomation.com/t/how-to-set-focus/14445 "2017-06-02T12:55:38Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Ryan\_Shaw](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Ryan\_Shaw](https://forum.inductiveautomation.com/u/Ryan_Shaw)\
**Post date:** [February 19, 2024, 11:43am UTC](https://forum.inductiveautomation.com/t/how-to-set-focus/14445/15 "2024-02-19T11:43:27Z")

</div>

This is the first item returned by searching "Ignition text field set focus" on Google so I think it's appropriate to add here. When the methods above didn't work for me I realized I was using a Text Area, not a Text Field. The script provided at [Set focus on any input control](https://forum.inductiveautomation.com/t/set-focus-on-any-input-control/5238) was useful for finding out that for a Text Area the request focus script is really

```auto
getComponent('Text Area').components[0].components[0].requestFocus()

```

This sets the cursor at position 0. I wanted to set it at the end of the text, so I ended up using

```auto
c = getComponent('Text Area').components[0].components[0]
c.requestFocus()
c.setCaretPosition(len(c.text))

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-set-focus/14445)._
