Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a jquery select for multiple form elements?

i want to get back an array of all:

  1. hidden inputs
  2. text inputs
  3. select inputs
  4. checkboxes

I see this page but it seems like you have to query for checkboxes seperately

is there anyway to have one selector get everything in one array?

like image 788
leora Avatar asked Aug 05 '26 04:08

leora


1 Answers

This will return what you're looking for I think...

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

I'm not sure if you needed this or not as well but for text areas you'd also want to add...

$("textarea")
like image 73
Ryan Avatar answered Aug 06 '26 19:08

Ryan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!