Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#7937 closed bug (invalid)

About the event change for the textbox

Reported by: anonymous Owned by:
Priority: undecided Milestone:
Component: event Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

Hello everyone here in JQuery:

I notice that if I bind the event for textbox in pure html codes, something like this:

$(function(){

$("#textbox1").change(function(){alert("OK!")});

})

【suppose textbox1 is the id of the textbox in pure HTML form】

I notice that the alert messagebox won't be popuped during I finish changing the value of textbox until i click some other places or raise another event... don't know why?

Change History (1)

comment:1 Changed 9 years ago by jitter

Component: unfiledevent
Milestone: 1.next
Resolution: invalid
Status: newclosed
Type: enhancementbug

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

This isn't a bug but the behavior as specified by the W3C

The change event occurs when a control loses the input focus and its value has been modified since gaining focus. This event is valid for INPUT, SELECT, and TEXTAREA. element.

Typing in the textarea (obviously) doesn't cause a focus lose while clicking outside of the textarea (or similar actions) remove the focus from the textarea and trigger the change event (if appropriate).

If you want to trigger some behavior while the user types you are better advised to look into the keyXXX-events but as the jQuery bug tracker is not meant for support requests please use the jQuery Forum if you need further help on this one or log onto the #jquery IRC channel on freenode.

Note: See TracTickets for help on using tickets.