How to capture submit event using jQuery in an ASP.NET application?

前端 未结 8 2060
既然无缘
既然无缘 2020-12-01 03:11

I\'m trying to handle the submit event of a form element using jQuery.

    $(\"form\").bind(\"submit\", function() {
        alert         


        
8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 03:23

    Yeah, this is annoying. I replace __doPostBack with my own so that I could get submit events to fire.

    Iirc, this is an issue when submitting a form via javascript (which calls to __doPostBack do) in IE (maybe other browsers too).

    My __doPostBack replacement calls $(theForm).submit() after replicating the default behavior (stuffing values in hidden inputs)

提交回复
热议问题