jQuery Form Plugin

http://jquery.malsup.com/form/

Form Plugin API
ajaxForm

Example:

$(‘#myFormId’).ajaxForm();

ajaxSubmit

Example:

// attach handler to form’s submit event
$(‘#myFormId’).submit(function() {
// submit the form
$(this).ajaxSubmit();
// return false to prevent normal browser submit and page navigation
return false;
});

formSerialize
Serializes the form into a query string. This method will return a string in the format: name1=value1&name2=value2
Chainable: No, this method returns a String.

Example:

var queryString = $(‘#myFormId’).formSerialize();

// the data could now be submitted using $.get, $.post, $.ajax, etc
$.post(‘myscript.php’, queryString);

END

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • MySpace
  • Plurk
  • RSS
  • Google Buzz
  • Live
本篇發表於 Ajax+jQuery, plugin (jQuery)。將永久鏈結加入書籤。

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *