[jQuery] Re: click() on submit button doesn't trigger form's jquery submit handler

2008-07-22 Thread Will Moffat
Hi guys, thanks for the replies, and sorry for the delay in responding. I see that didn't clearly state the context of my problem. I want to use jQuery to simulate mouse clicks for many different HTML elements (not just form submit buttons). My test shows that jQuery.click() doesn't give same

[jQuery] click() on submit button doesn't trigger form's jquery submit handler

2008-07-09 Thread Will Moffat
I expected that calling click() on a submit button would trigger a form's submit handler, but this doesn't seem to be the case. Example: register a jQuery submit handler: $('form').submit(function() { alert('jquery submit handler'); }); Then click the corresponding submit button:

[jQuery] Re: How to get the first matching parent of each element?

2008-03-26 Thread Will Moffat
Thanks Ariel, Is there an elegant way to return the _first_ matching parent of each element in a collection? Am I missing something obvious? Yes, it seems I was :-( $('.clickable').map(function(){    return $(this).parents('.container')[0]; }); That's exactly what I was looking for.