var values = $("input[name='cities[]']").serializeArray();
will give you a JS object from the selected checkboxes, you can now convert the object to json and pass to your ajax method.


you can also serialize the entire form and handle the posted data on the server side script


maybe you should post the whole form. might be easier to understand what you exactly want to achieve.




On Tue, Sep 6, 2011 at 10:29 AM, Peter Karunyu <pkarunyu@gmail.com> wrote:
Maybe I should have explained my goal; to 'harvest' all form data when the user clicks the submit button, then submit them using jQuery powered AJAX.

If the user checked 2 out of the 3 checkboxes, will jQuery 'remember' the ones the user checked?



On Tue, Sep 6, 2011 at 10:24 AM, Chris Mwirigi <mwirigic@gmail.com> wrote:
+1

On Tue, Sep 6, 2011 at 10:11 AM, Erick Njenga <eriknjenga@gmail.com> wrote:
How about giving them a class attribute and adding something similar to:

$(".class_name").click(function(){
//use $(this) to get the exact checkbox that was clicked
$(this).attr("value"); //This will get the value of the checkbox 
});

HTH 


Thanks and Regards,
Erick Njenga Nyachwaya,







_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke


_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke



--
Regards,
Peter Karunyu
-------------------
Web Performance Evangelist
Make your website and web app faster.


_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke