# Getting 'on(release, keyPress"\<Enter\>")' to work with an InputText box

**URL:** <https://forum.kirupa.com/t/getting-on-release-keypress-enter-to-work-with-an-inputtext-box/249458>\
**Category:** flash\
**Created:** [January 18, 2008, 10:36pm UTC](https://forum.kirupa.com/t/getting-on-release-keypress-enter-to-work-with-an-inputtext-box/249458 "2008-01-18T22:36:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vfranklyn](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vfranklyn](https://forum.kirupa.com/u/vfranklyn)\
**Post date:** [January 18, 2008, 10:36pm UTC](https://forum.kirupa.com/t/getting-on-release-keypress-enter-to-work-with-an-inputtext-box/249458/1 "2008-01-18T22:36:49Z")

</div>

Hi there. I’m a noob (clearly), and I’m trying to get an InputText field to submit text to a Google site search by hitting the Enter key. I can get it to work when I click on a button, but I’d really like it to work with just hitting the Enter key. Right now, when I hit the Enter key it erases the text from the search box (but doesn’t actually clear the search).

I think there must be a simple way to do this and I must be missing some key step.

I have an InputText box that is named “searchword” and a button named “Searchbtn” containing the following ActionScript command:

on(release, keyPress"\<Enter\>"){  
getURL(“[http://www.google.com/search?q=](http://www.google.com/search?q=)” + escape(searchword.text+" site:ppld.org"), “\_blank”)  
}

Like I said, everything but the ‘on(release, keyPress"\<Enter\>")’ is working.

I’ve also tried ‘on(keyPress"\<Enter\>")’, but I get the same result.

Any tutorial or nudge in the right direction would be greatly appreciated!
