# Selecting text string in Input Text box with AS?

**URL:** <https://forum.kirupa.com/t/selecting-text-string-in-input-text-box-with-as/100551>\
**Category:** Uncategorized\
**Created:** [January 30, 2004, 10:55pm UTC](https://forum.kirupa.com/t/selecting-text-string-in-input-text-box-with-as/100551 "2004-01-30T22:55:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmartin](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@cmartin](https://forum.kirupa.com/u/cmartin)\
**Post date:** [January 30, 2004, 10:55pm UTC](https://forum.kirupa.com/t/selecting-text-string-in-input-text-box-with-as/100551/1 "2004-01-30T22:55:31Z")

</div>

Would like to implement functionality for when a user changes focus to an Input Text box, the text it contains will become **automatically** selected and ready to copy (Ctrl-C) or overwritten.

Had tried the following to no avail (in MX 2004 Pro):

[AS]  
name\_txt.onSetFocus = function(oldFocus) {  
Selection.setFocus(this);   
Selection.setSelection(0,-1);  
}  
[/AS]

Is this even possible? :h:
