How to serialize all li#id within an ul with jquery.serialize()?
First of all, I am not using the jQuery-UI, only latest jQuery!
I have following list:
<ul id="audio_list">
<li id="trackid_1"></li>
<li id="trackid_5"></li>
<li id="trackid_2"></li>
<li id="trackid_4"></li>
<li id="trackid_3"></li>
</ul>
Now I'd like to serialize this list and save it as an array in a variable,
like:
var myaudiotracks = jQuery('#audio_list').serialize();
All I get is an empty string, of course, because I am missing something or
it is not possible to serialize lists with jQuery only.
What I am trying to accomplish is to send this variable as an array to a
PHP script, the result when posting the variable should be:
trackid[] 1
trackid[] 5
trackid[] 2
trackid[] 4
trackid[] 3
Any ideas how I can get to this result?
No comments:
Post a Comment