# Perspective TextField SelectAll OnFocus

**URL:** <https://forum.inductiveautomation.com/t/perspective-textfield-selectall-onfocus/45826>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [April 20, 2021, 7:45pm UTC](https://forum.inductiveautomation.com/t/perspective-textfield-selectall-onfocus/45826 "2021-04-20T19:45:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![francois.morin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/francois.morin/32/15064_2.png) [@francois.morin](https://forum.inductiveautomation.com/u/francois.morin)\
**Post date:** [April 20, 2021, 7:45pm UTC](https://forum.inductiveautomation.com/t/perspective-textfield-selectall-onfocus/45826/1 "2021-04-20T19:45:25Z")

</div>

How can I make sure all text is selected in a TextField when it gets focus, no matter how it gets it (click, touch, tab, Focus() script).

I have tried to put a “self.selectAll()” script on the TextField.Focus event but it does not work.

---

<div class="post-metadata">

**Author:** ![rbachman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rbachman/32/43718_2.png) [@rbachman](https://forum.inductiveautomation.com/u/rbachman)\
**Post date:** [July 26, 2021, 6:30pm UTC](https://forum.inductiveautomation.com/t/perspective-textfield-selectall-onfocus/45826/2 "2021-07-26T18:30:10Z")

</div>

We’re having a similar issue. Anyone know how to do this?

---

<div class="post-metadata">

**Author:** ![francois.morin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/francois.morin/32/15064_2.png) [@francois.morin](https://forum.inductiveautomation.com/u/francois.morin)\
**Post date:** [July 26, 2021, 6:50pm UTC](https://forum.inductiveautomation.com/t/perspective-textfield-selectall-onfocus/45826/3 "2021-07-26T18:50:38Z")

</div>

The answer I received is that it can only be done using Javascript on client side.  
Since python scripts are only for server side, I don’t think there is a way to do that at the moment.  
It might be good feature request to add a new property “SelectAllOnEnter” on textfield that will execute the javascript to select the text.
