On Wed, Jul 9, 2008 at 10:46 AM, Will Moffat <[EMAIL PROTECTED]> wrote:
>
> 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:
> $('input[type=submit]').click();
>
> The submit handler isn't fired.
>
> Live example: 
> http://mqlx.com/~willmoffat/learn_feature/jquery/click_submit.html
>
> Is this a bug or a feature?
> regards,
> --Will
>



try using the submit event instead:

$('input[type=submit]').bind('submit', function(){alert("submitted !");});

-- 
Alexandre Plennevaux
LAb[au]

http://www.lab-au.com

Reply via email to