views:

472

answers:

3

How do u collect all the checkboxes and dropdownlist items inJQuery for saving

+2  A: 

One way is to use the jQuery Form plugin, like this:

$('#myFormId').formSerialize();

From the formSerialize API documentation:

Serializes the form into a query string. This method will return a string in the format: name1=value1&name2=value2
karim79
+2  A: 

Or, for recent versions of jquery you can use:

http://docs.jquery.com/Ajax/serialize

or

http://docs.jquery.com/Ajax/serializeArray

ScottE
A: 

$('#myFormId').formSerialize(); is a plugin and maybe not necessary. The core function serialize() is better.

http://docs.jquery.com/Ajax/serialize

Elzo Valugi
My view state is also visible when I am doing a .serialize
Greens