jQuery $.ajax POST Multiple Select Selections

I have a multipe select as part of my imput form and I would like to submit it's selected values via jQuery AJAX.

I've tried to use the following syntax.


That works, bu the problem I am having is that the user is not required to select anything from the multiple select. If they don't I get an error because you cannot join a null object.

Any Suggestions?

Also keep in mind that there are other values being submitted. For example:

data: "name=" + $("#name").val() + "&multipleselect=" + $("#multipleselect").val().join('|');


You can use serialize method:

Encode a set of form elements as a string for submission.

var data = $('form').serialize()

Need Your Help

android upload image to amazon storage with image path

android image amazon-web-services

I want to upload a image using it's file path. Most of the tutorial I have followed regarding upload image to amazon, there is select image option(image chooser from galary). But what i need is tha...

At runtime, how can I test whether a Property is readonly?

c# properties

I am auto-generating code that creates a winform dialog based on configuration (textboxes, dateTimePickers etc). The controls on these dialogs are populated from a saved dataset and