Skip to main content

Bug Tracker

Side navigation

#6192 closed bug (invalid)

Opened March 01, 2010 02:33PM UTC

Closed October 02, 2010 06:16PM UTC

Last modified May 29, 2012 07:33PM UTC

event.srcElement is incorrect when calling jquery.change() from within a click handler

Reported by: bpstoxin Owned by:
Priority: undecided Milestone: 1.4.3
Component: event Version: 1.3.2
Keywords: .Net ValidatorOnChange event change click Cc:
Blocked by: Blocking:
Description

I am currently using .Net and I am getting an error in the ValidatorOnChange() method because .Net attempts to use the event.srcElement property to determine which validators to use.

I have tracked down the issue and it results because in a jQuery.click() handler I have to change the value of another control and call jQuery.change() for that control. This causes the event.srcElement to point to the control in which the click event was triggered for.

I have attached a scaled down example which demonstrates the problem without the need of .Net. You will notice that it works correctly in browsers other than IE so long as you pass event as an argument to the onchange handler. I am not sure if .Net does this or not.

Attachments (1)
  • jQueryBug.htm (0.7 KB) - added by bpstoxin March 01, 2010 02:33PM UTC.
Change History (4)

Changed October 02, 2010 06:16PM UTC by snover comment:1

priority: → undecided
resolution: → invalid
status: newclosed

If you bypass jQuery’s event handling system, as you are doing here, do not expect things to work properly.

Changed November 03, 2010 09:58PM UTC by mkubarycz@ocpafl.org comment:2

I don't think the example "bypass jQuery’s event handling system". I am pretty sure he was just trying to use the event handling system. This feature would have been usefull (if it worked in IE).

Looks like someone didn't want to fix this bug. Must be nice.

Changed May 26, 2011 11:41AM UTC by rogi1 comment:3

hmm... also Asp.Net eventhandler bypass your event handling system, the "ValidatorOnChange" event throws an exception in couse of an manually invoked change event.

Changed May 29, 2012 07:33PM UTC by ivanfrank@gmail.com comment:4

The problem is with IE and the window.event object being null; it has nothing to do with jQuery. Any time you call, for example, the onchange() of a select box that has a Validator bound to it, you will get an error in IE 8- because of the window.event being null.