You will have to dig it out of the DOM data. But let me tell you, this is not recommended. Try it,
var form = $('#myForm'); var data = form.data(); var events = data.events;
If a handler function is attached to the submit form, it will be present as
var submit_list = events.submit;
Now, if all goes well, at best you can get submit_list as a list of all handler objects attached to submit the form event.
Shortcut: Assuming you have one and only one handler attached to dispatch an event for #myForm ,
$('#myForm').data().events.submit[0].handler
is your function.
Play with data() , but remember that this is not recommended. Happy coding.
simplyharsh
source share