Fixed docs for #134

This commit is contained in:
Jörn Zaefferer 2006-12-11 09:38:03 +00:00
parent 665e1959cc
commit 3e3240f7ed

View File

@ -228,9 +228,11 @@ new function(){
/** /**
* Bind a function to the submit event of each matched element. * Bind a function to the submit event of each matched element.
* *
* @example $("p").submit( function() { alert("Hello"); } ); * @example $("#myform").submit( function() {
* @before <p>Hello</p> * return $("input", this).val().length > 0;
* @result <p onsubmit="alert('Hello');">Hello</p> * } );
* @before <form id="myform"><input /></form>
* @desc Prevents the form submission when the input has no value entered.
* *
* @name submit * @name submit
* @type jQuery * @type jQuery
@ -242,9 +244,11 @@ new function(){
* Trigger the submit event of each matched element. This causes all of the functions * 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. * that have been bound to thet submit event to be executed.
* *
* @example $("p").submit(); * Note: This does not execute the submit method of the form element! If you need to
* @before <p onsubmit="alert('Hello');">Hello</p> * submit the form via code, you have to use the DOM method, eg. $("form")[0].submit();
* @result alert('Hello'); *
* @example $("form").submit();
* @desc Triggers all submit events registered for forms, but does not submit the form
* *
* @name submit * @name submit
* @type jQuery * @type jQuery