I used the excellent moreSelectors plugin on a project about a year ago and I just discovered that the old code has stopped working. I'm using window.onbeforeunload to call a function that checks to see if there are any modified form fields and alert the user that changes will be lost. The code below used to work but after an upgrade to jQuery 1.2.3 it no longer works. I'm unsure if the jQuery upgrade is actually the culprit however. [code] var unsaved = $ ("#formId").find("*:modified").not(":checkbox, :radio, :submit, :hidden").size(); [/code]
I've tried to simplify the code to just test the :modified selector but no luck. With this code unsaved is still undefined: [code] var unsaved = $("#formId:modified").size(); [/code] Any ideas anyone?