2010-01-02 60 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

相關問題