【发布时间】:2009-06-16 15:22:51
【问题描述】:
如何收集jQuery中的所有复选框和下拉列表项进行保存?
【问题讨论】:
-
大相关问题之间 - stackoverflow.com/a/1186309/11236
标签: jquery forms collections
如何收集jQuery中的所有复选框和下拉列表项进行保存?
【问题讨论】:
标签: jquery forms collections
或者,对于最新版本的 jquery,您可以使用:
http://docs.jquery.com/Ajax/serialize - 转为 URL 编码字符串 person.name=john&person.age=20
或
【讨论】:
一种方法是使用 jQuery Form 插件,像这样:
$('#myFormId').formSerialize();
来自formSerialize API documentation:
Serializes the form into a query string. This method will return a string in the format: name1=value1&name2=value2
【讨论】:
.formSerialize()结果传递给ajaxSubmit()?
$('#myFormId').formSerialize();是一个插件,也许没有必要。 核心函数serialize()更好。
【讨论】: