Skip to main content

Bug Tracker

Side navigation

#13109 closed bug (wontfix)

Opened December 23, 2012 01:42AM UTC

Closed December 23, 2012 01:50AM UTC

on click event gets past the form submit

Reported by: anonymous Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: git
Keywords: Cc:
Blocked by: Blocking:
Description

In stack you can find the qactuall bug report and its realization in fiddle. Pls confirm if positive and if posible vote it back up. :)

**This is a theoretical question, the bug is solved, over 2 days ago. no wich hunting, im just curios why the subit handler gets past the jqery and if this isa bug!**

So ppl stop grading - and provide input if you have any constructive.

I had a form which had an on click event bound to it.

like

<form name = 'oldCode'>

anoying legacy code old over 10 years

<input type='submit' onclick='document.oldCode.submit()'>

</form>

Now before that i put a jqery option which should have captured the submit action of the form:

$(document).ready(function(){

$('correct form selector id').submit(function(){

alert(1);

})

})

But oddly enough this dous not ever get executed....

But when i used a standard js like

document.oldCode.submit = function(){

alert(1);

all worked 100% like it shold, im asking is this a bug or a feature???

}

Here is an example of the code....

http:jsfiddle.net/StCPp/4/

soooo is this a bug or some kind freak of nature????

http://stackoverflow.com/questions/14007919/possible-jquery-bug

http://jsfiddle.net/StCPp/4/

Attachments (0)
Change History (1)

Changed December 23, 2012 01:50AM UTC by rwaldron comment:1

resolution: → wontfix
status: newclosed

From what I can tell the question is about inline event handlers, which is on our Won't Fix list.