# Blanking a text box on click!

**URL:** <https://forum.kirupa.com/t/blanking-a-text-box-on-click/91684>\
**Category:** Uncategorized\
**Created:** [October 7, 2003, 6:58pm UTC](https://forum.kirupa.com/t/blanking-a-text-box-on-click/91684 "2003-10-07T18:58:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrhb](https://avatars.discourse-cdn.com/v4/letter/l/e47774/32.png) [@lrhb](https://forum.kirupa.com/u/lrhb)\
**Post date:** [October 7, 2003, 6:58pm UTC](https://forum.kirupa.com/t/blanking-a-text-box-on-click/91684/1 "2003-10-07T18:58:06Z")

</div>

Hello!

I’m trying to blank out an input field when the user clicks on it… I tried making the text field a movie clip with the following code:

[AS]onClipEvent(mouseDown){  
searchItem = “”;  
}

onClipEvent(keyDown){  
if (Key.getCode() == Key.ENTER){  
\_root.query(“quickSearch”, searchItem);  
}  
}[/AS]

… and it works, but the problem is it works when you click _anywhere_. Is there a way I can do this _only_ when the user clicks in the input field?

Thanks in advance!! :hat:

lrhb
