I've done some further testing using this simplified code: var unsaved
= $("*:selector").size();

The following selectors work as expected (returning the correct number
of elements):
:text
:textarea
:select
:selected
:multiple

The :modified selector returns undefined. The odd thing is that this
seems to be, at least coincidentally, related to another problem I'm
having with firebug. Firebug has been ignoring breakpoints and the
debug directive lately and I've determined that, at least in the test
code I'm using, it only does this when using the :modified selector.
I'm completely stumped.

Any thoughts?

On Mar 26, 10:05 am, Stuart <[EMAIL PROTECTED]> wrote:
> 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?

Reply via email to