# \[help\] Selection.setSelection()

**URL:** <https://forum.kirupa.com/t/help-selection-setselection/218717>\
**Category:** flash\
**Created:** [March 10, 2007, 12:26am UTC](https://forum.kirupa.com/t/help-selection-setselection/218717 "2007-03-10T00:26:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mixey](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mixey/32/1979_2.png) [@mixey](https://forum.kirupa.com/u/mixey)\
**Post date:** [March 10, 2007, 12:26am UTC](https://forum.kirupa.com/t/help-selection-setselection/218717/1 "2007-03-10T00:26:36Z")

</div>

Hi!  
I have several input fields with default values, how can I select them(values) when I’m pressing on the text field?

for example input field with instance name “user\_name” and default value “enter your name”

```auto
user_name.onSetFocus = function() {
    Selection.setFocus(this);
    Selection.setSelection();
}

```

but it didn’t work for me ☹
