I’m trying to use the $(':input') selector but it’s not selecting disabled ones, nor hidden ones.
$(':input').serialize()
Although the form tag is enclosing everything, it just serialize a few ones because other parts are in other divs and that seems to broke the form.
Is there anyway to select all inputs including hidden and disabled ones?
I know I could do it by selecting manually by each field’s ID but it’s not the best approach IMO.
The problem is not that the
:inputselector isn’t targeting disabled inputs, it’s that theserialize()method does not serialize disabled inputs.The
serialize()documentation states;The link goes on to explain that; Controls that are disabled cannot be successful..
Hidden input fields should be both selected by the
:inputselector, and serialized by theserialize()method; which is what this JSFiddle shows; http://jsfiddle.net/H2g6Q/