You can't return anything rom $().each, and object literals are not scope blocks, that won't work, it would have to be something like this:
$(function() { //serialize() creates a query string from the form elements provided var reqData = $('.litqty').serialize(); $("form#form_search_country").submit(function() { $.post('submitLitRequest.php', reqData); return false; }); }); On Apr 9, 5:02 pm, "mattimus5...@gmail.com" <mattimus5...@gmail.com> wrote: > Ok I see your code from the above post now. > > var reqData = { > $('select.litqty').each( > $(this).attr('name') : $(this).val(); > ); > } > This would get the name and value of each select.litqty > Is this what you are trying to achieve?? > > On Apr 9, 3:48 pm, "mattimus5...@gmail.com" <mattimus5...@gmail.com> > wrote: > > > You are just trying to get the value of the select box and only the > > select box??? > > > So you have something like > > <ul class="books"> > > <li> Book 1 <select class="litqty"><option...... /></select></li>??? > > <li> Book 2 <select class="litqty"><option...... /></select></li> > > <li> Book 3 <select class="litqty"><option...... /></select></li> > > <li> Book 4 <select class="litqty"><option...... /></select></li> > > </ul> > > > What do you need reqData to look like?