ha, ha. I figured it out finally, and of course it's obvious when you look at it and has nothing to do with what I thought it did.
Here's the thing: the form (or whatever it is) gets submitted via the click on the button. So adding another click listener puts that second listener at the end of the queue, and the function fires too late (I don't know how this fits in with LIFO, or maybe I just don't understand LIFO).
But of course using mousedown means you get to sneak in before the click function fires and do your validation routine.
Thanks for sticking with me, though, rnd me. It was an interesting discussion regardless.
Well, I never give up, especially for fellow regulars. I've always found jQuery events incredibly complicated and confusing when it comes to working on them from the outside. With event attribs, you can see what's doing what, but jQuerys are invisible and hard to control. Especially when you have to adjust a fully-implemented site you didn't create, it can be a bear.
Earlier in my career, i had a related problem that drove me to the edge of sanity: Ihad to clone and hide a button in order to add the event up-front. Once the clone's click was complete, it dispatched a mousedown(), click(), and mouseup() to the orig but now-hidden button. A convoluted workaround for sure, but one that ultimately bought six more months until a site rebuild.
Anyways, glad it's resolved...
__________________ my site (updated 5/13) STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
I've always found jQuery events incredibly complicated and confusing when it comes to working on them from the outside. With event attribs, you can see what's doing what, but jQuerys are invisible and hard to control.
ha! pretty much the topic of my other post - it works, I just don't know why. Which for some reason I find even more frustrating than the other way 'round...
Or perhaps this is a tweaked version of the event object?
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
based on the desire of "semantic documents" javascript was moved from binding ui inline to external files. While it might make librarians happy, the practice is frustrating to people who maintain web apps.
__________________ my site (updated 5/13) STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%