# Default text disappear onclick of InputText

**URL:** <https://forum.kirupa.com/t/default-text-disappear-onclick-of-inputtext/282415>\
**Category:** flash\
**Created:** [February 21, 2009, 7:16pm UTC](https://forum.kirupa.com/t/default-text-disappear-onclick-of-inputtext/282415 "2009-02-21T19:16:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrMangoes](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@MrMangoes](https://forum.kirupa.com/u/MrMangoes)\
**Post date:** [February 21, 2009, 7:16pm UTC](https://forum.kirupa.com/t/default-text-disappear-onclick-of-inputtext/282415/1 "2009-02-21T19:16:19Z")

</div>

Hello!  
I have an InputText field for users to submit information to me. I want to have the text field display some default text (Ex. Type E-Mail Here) and then when the field is clicked, the text will be cleared.  
After a long time of searching a found a solution that works perfectly…using ActionScript 2.0. Unfortunately my site is in 3.0 therefore I cannot use this code.

For the example I want my default text to be “Type E-Mail Here”, and the InputText Instance Name will be “inputTxt”  
Here is the 2.0 code:

```auto
 
inputTxt.textField = "Type E-Mail Here..."
inputTxt.onSetFocus = function() {
    inputTxt.textField = ""
    
};
inputTxt.onKillFocus = function() {
    
    inputTxt.textField = "Type E-Mail Here..."
};

```

When using this code in AS3, I get the error code “1120: Access of undefined property inputTxt”. What do I need to make this code work in AS3?

Thanks a million in advance.

- Mangoes
