Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i get all inputs excluding buttons and hidden fields with jquery?

I've got the following which will excludes all buttons, but how can I also exclude hidden fields?

$("#selector").find(":input:not(:button)").each(function (i) { // do something

I'm sure this is probably simple, I just can't find it.

Many thanks!

like image 565
Chris Conway Avatar asked Jun 07 '10 14:06

Chris Conway


People also ask

How can remove hidden field value in jQuery?

in jquery: $('#hiddenfieldid'). val(''); Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM.

How to select input type hidden in jQuery?

#3 jQuery Code To Get hidden field value by typevar getValue= $("input[type=hidden]"). val(); alert(getValue); Here in the above jquery code, we select input hidden filed by its type i.e hidden, and then by using jquery . val() we get the hidden field value.

How can store hidden field value in jQuery?

In jQuery to set a hidden field value, we use . val() method. The jQuery . val() method is used to get or set the values of form elements such as input, select, textarea.

What is hidden field in Javascript?

A hidden field lets web developers include data that cannot be seen or modified by users when a form is submitted. A hidden field often stores what database record that needs to be updated when the form is submitted.


1 Answers

the following code should do it..

$('#selector :input').not(':button,:hidden').each(...);
like image 100
Gabriele Petrioli Avatar answered Oct 06 '22 21:10

Gabriele Petrioli