Greetings. I would like to know the difference and how to change this record var serializeValues = $(this).find("input[type='hidden'], :input:not(:hidden)").not('.table-element').serialize(); to select type=hidden but not display:none ? She for some reason does not work, does not choose either

  • input type = hidden - is used only for the form that would transmit hidden information about the site (for example, encrypted ay-di session). Visible, it does not happen (that's the whole point). A display: none is used in styles to hide temporarily or permanently an element that may be visible. - nick_n_a
  • Well, it is in principle clear, what about the second question? - VK
  • replace :input:not(:hidden)" with :input:visible" ? - lexxl
  • hmm, it helped, but as far as I understand, these expressions are equivalent in fact ... - VK

1 answer 1

1) Your input type=hidden is a hidden field. It does not appear on the web page (hidden), but is present on it. It is used, as a rule, for information transfer, for example, in forms. And display: none - temporarily removes (and does not visually hide) an element from the document. The place he occupies is not reserved and the web page is formed as if the element was not there.

Sources: display | input type

2) It is necessary to replace :input:not(:hidden) with :input:visible , since : hidden in your code is a jQuery filter that helps refine the selection by other selectors. It looks like a CSS pseudo-class, hence the confusion, probably.

More information on the links:

jQuery - Selectors | jQuery - Visible Items | jQuery - Invisible Elements