lonewolf217 Posted May 30, 2009 Share Posted May 30, 2009 This is what I am working with right now. I have a large form with multiple text, select and select multiple elements <script type="text/javascript"> $(document).ready(function() { var jInput = $(":input"); $("#submit").click(function() { var str = $("#resFilters").serialize(); alert(str); $.post("test.php",$("#resFilters").serialize(),function(data) { if(data.length > 0) { $('#resources').fadeIn('slow'); $('#resources').html(data); } }); return false; }); }); </script> on my backend page, i do <?php echo "<pre>"; print_r($_POST); echo "</pre>"; and for one of my select multiple fields on which I had selected multiple elements, it is only displaying one result, the last result I have tried doing some research on how serialize works, but all I can find is that it is supposed to handle multiple selects without a problem, but I do not know how much simpler I can make it. if I output an alert from my main page with the contents of the serialized form, I can see that it is formatted like "OS=windows&OS=unix", but how do I retrieve it? I tried <?php foreach($_POST['OS'] as $os) { echo "OS=".$os."<br>"; } but it outputs nothing, so now I am a little more confused why print_r($_POST) returns something, but not this any help, or shove in the right direction is appreciated Quote Link to comment Share on other sites More sharing options...
lonewolf217 Posted May 30, 2009 Author Share Posted May 30, 2009 nevermind, finally figured it out Quote Link to comment Share on other sites More sharing options...
suresh.rajagopal Posted July 30, 2009 Share Posted July 30, 2009 Hai can you please assist me how you resolved Serializing problem in your code. am facing same problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.