Serialize() not working in Internet Explorer
This works fine in FF, Chrome, Safari, but not in IE8
var z = $($('form')[0].elements).not("#x, #y").serialize();
Field names and values of 'x' and 'y' are omitted from the serialize() output string.
ID and name attributes are the same for each element, name="x"
, id="x"
for one, name="y"
, id="y"
for the other.
But in IE the serialized form data always returns the name and value for element id="x"
and id="y"
, which I need to excl开发者_JS百科ude as part of the form validation.
Is this a known bug in IE? I can find no specific solution to this problem online.
Thanks in advance
Ok, it seems the following works:
$('form :input:not(#x, #y)').serialize();
精彩评论