<form id="lol" method="post" action="?" zidprofile="210" zmarked="true" referer="http://yahoo.com/">
<input type="text" name="age" value="22" />
<input type="text" name="name" value="Jhon" ztarget="415" />
<input type="text" name="mail" value="test@gmail.com" zcodeg="inner" />
<input type="submit">
</form>
When form submited print this:
Array (
[age] => 22,
[name] => Jhon,
[mail] => test@gmail.com
)
But Jquery and serialize return only:
alert($('#lol').serialize()); // age=22
And:
$('input[zcodeg="inner"]').each(function(){
alert($(this).attr('name'));
});
Work!, alert: “mail”
What happen?
it seems serialize() does not support custom attributes in input fields however… take them out and use common attributes like
rel=""or if your using HTML5 you may wanna use thedata-attribute. maybe it works with this attributes