Serialize Subsection

Serialize Subsection
 点击下载

ALERT This plugin does not work with any current release of jQuery. It will work after revision 5826 with no changes. Prior to that it will require you to modify serializeArray() to query the existence of this.elements instead of jQuery.nodeName(this, "form").

This plugin creates a serialize function that operates on elements descending from a form. Requires the plugin.

Usage:

  1. <form> 
  2.     <ol> 
  3.         <li id="first"> 
  4.             <input id="firstname" type="text" /> 
  5.             <input id="lastname" type="text" /> 
  6.         </li> 
  7.         <li> 
  8.             <input id="address1" type="text" /> 
  9.             <input id="address2" type="text" /> 
  10.         </li> 
  11.         <li> 
  12.             <input id="mobile" type="text" /> 
  13.             <input id="email" type="text" /> 
  14.         </li> 
  15.     </ol> 
  16. </form> 
  17.   
  18.  
  19.   
  20.  
  21. // Returns the same results as if serializeArray() were called on the parent form element, restricted to only include the elements descending from the form. 
  22. $(#first).serializeSubsection(); 

 

 

转载请注明:代码家园 » Serialize Subsection

评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)