开发者

JQuery dirtyForm not working on text boxes in ajaxToolkit:TabPanel

开发者 https://www.devze.com 2022-12-24 07:42 出处:网络
I\'m using Asa Wilson\'s plugin jquery.dirtyform.js to prompt a user of unsaved changes before they nav away from a page 开发者_JAVA百科(ASP.Net C# 3.5).

I'm using Asa Wilson's plugin jquery.dirtyform.js to prompt a user of unsaved changes before they nav away from a page 开发者_JAVA百科(ASP.Net C# 3.5).

It basically loops through all controls and appends a class and handler to each input. Controls w/i an ajaxToolkit:TabPanel are ignored, unfortunately.

I'd appreciate if anyone knows of this type of error and how to resolve it short of manually manipulating each control (as I have this logic in the master page).


Found the problem. The content in the AJAX TabPanel wasn't rendered when the jQuery event $(document).ready() fired, thus the controls were not "watched".

I simply added an event to the rogue controls to re-fire $("form").dirty_form();

Seems to be working thus far. I'm sure there is a more eloquent solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消