# Urgent help -----onchange is not working

**URL:** <https://www.ruby-forum.com/t/urgent-help-onchange-is-not-working/133787>\
**Category:** Rails\
**Created:** [April 3, 2008, 4:43pm UTC](https://www.ruby-forum.com/t/urgent-help-onchange-is-not-working/133787 "2008-04-03T16:43:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mokkai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c2a13f/32.png) [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Post date:** [April 3, 2008, 4:43pm UTC](https://www.ruby-forum.com/t/urgent-help-onchange-is-not-working/133787/1 "2008-04-03T16:43:14Z")

</div>

i am using firefox 2.0.0.6  
the above html will open a a text box and button

step 1: enter into box ‘aaa’ & press button ‘Click Me’  
step 2: enter into box ‘aab’ & press button ‘Click Me’  
step 3: now if you enter ‘a’ into box then autocomplete drop down will  
open  
so you can select from that(which r given previously)

but alert is not working

---

<div class="post-metadata">

**Author:** ![mokkai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c2a13f/32.png) [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Post date:** [April 3, 2008, 5:13pm UTC](https://www.ruby-forum.com/t/urgent-help-onchange-is-not-working/133787/2 "2008-04-03T17:13:05Z")

</div>

On 3 Apr 2008, at 15:43, Pokkai D. wrote:

> step 2: enter into box ‘aab’ & press button ‘Click Me’  
> step 3: now if you enter ‘a’ into box then autocomplete drop down will  
> open  
> so you can select from that(which r given previously)

If I remember correctly onChange on a text input only fires where the  
field loses focus.

Fred

---

<div class="post-metadata">

**Author:** ![mokkai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c2a13f/32.png) [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Post date:** [April 4, 2008, 6:47am UTC](https://www.ruby-forum.com/t/urgent-help-onchange-is-not-working/133787/3 "2008-04-04T06:47:57Z")

</div>

Frederick C. wrote:

> If I remember correctly onChange on a text input only fires where the  
> field loses focus.
> 
> Fred

yes ,but why onchange is not triggered when the field loss focus at  
autocomcomplete only ?

---

<div class="post-metadata">

**Author:** ![mokkai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c2a13f/32.png) [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Post date:** [April 4, 2008, 7:54am UTC](https://www.ruby-forum.com/t/urgent-help-onchange-is-not-working/133787/4 "2008-04-04T07:54:09Z")

</div>

actually that the onchange is not triggered when i select something in  
the browsers autocomplete list?
