X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fevent%2Fevent.js;h=9f903212597aa2a687d8a438ab101f6508a0a762;hb=3e3240f7ed52c035f3f68d50836f089bd2d03409;hp=b480857bc9a9367c3d9aac01196521581c889837;hpb=665e1959cc03292a5109796dc1618d3848ec6f6e;p=jquery.git diff --git a/src/event/event.js b/src/event/event.js index b480857..9f90321 100644 --- a/src/event/event.js +++ b/src/event/event.js @@ -228,9 +228,11 @@ new function(){ /** * Bind a function to the submit event of each matched element. * - * @example $("p").submit( function() { alert("Hello"); } ); - * @before

Hello

- * @result

Hello

+ * @example $("#myform").submit( function() { + * return $("input", this).val().length > 0; + * } ); + * @before
+ * @desc Prevents the form submission when the input has no value entered. * * @name submit * @type jQuery @@ -242,9 +244,11 @@ new function(){ * Trigger the submit event of each matched element. This causes all of the functions * that have been bound to thet submit event to be executed. * - * @example $("p").submit(); - * @before

Hello

- * @result alert('Hello'); + * Note: This does not execute the submit method of the form element! If you need to + * submit the form via code, you have to use the DOM method, eg. $("form")[0].submit(); + * + * @example $("form").submit(); + * @desc Triggers all submit events registered for forms, but does not submit the form * * @name submit * @type jQuery