codedance / jquery.AreYouSure

A light-weight jQuery "dirty forms" Plugin - it monitors html forms and alerts users to unsaved changes if they attempt to close the browser or navigate away from the page. (Are you sure?)
508 stars 145 forks source link

Not working for imagebutton event #67

Open sabin30 opened 9 years ago

sabin30 commented 9 years ago

Hi, The dirty check is not happening when click in the imagebutton.I had image button to go next and previous date of date picker.I had added the dirty check method as below: <asp:ImageButton ID="lnkNextPeriod" ImageUrl="/images/pointer-right.png" CssClass="lnkNext" OnClientClick="$('form').trigger('checkform.areYouSure');" OnClick="lnkNextPeriod_Click" runat="server" />

Thanks Sabin

codedance commented 9 years ago

I think you're proposed solution is correct. If it's an image button is a "submit" button it should have worked. If it's just a standard button wired up to it's own click handler, I can see why you'd need to manually wire this up. I'd be happy to look into this further. Are you able to provide some sample HTML demonstrating the problem?