2010-01-02 57 views

回答

4

这将返回你要找什么,因为我觉得...

$("input:hidden, input:text, select, input[type='checkbox']") 

我不知道,如果你需要这个还是不很好,但文字方面会你也想添加...

$("textarea") 
+0

可能要包括':radio' – vol7ron 2011-09-06 20:23:18

1

$('input:hidden, input:text, input:checkbox, select')

4

根据您的目标,$('your_form_here').serialize()可能是你在找什么。它从表单中获取所有值,以便通过AJAX提交。

See the docs on serialize()

+0

瑞安的回答解决我的问题,但是这是非常有用 – leora 2010-01-03 14:43:01

2

尝试这些选择:

  1. 所有隐藏input S:input[type=hidden]
  2. 所有文字input S:​​
  3. 所有select S:select
  4. 所有复选框:input[type=checkbox]
+0

莱恩如下所述,您可以用'输入:text'等较短的选择,因为这里太mentiond HTTP: //docs.jquery.com/Selectors – 2010-01-02 21:22:20

相关问题