I have a simple multiple select which I am trying to send its selected values via ajax. I can use alert and it show the values selected to me but it goes through as blank in ajax. To test this, i tried to the replace and that doesn't work either. so there is something wrong and I can't figure it out!
<select id="multiple" multiple="multiple">
<option value="Text 1">Text 1</option>
<option value="Text 2">Text 2</option>
<option value="Text 3">Text 3</option>
</select>
If I choose options 2 and 3 the alert will show my selection like this:
var test = $("#multiple").val(); alert(test); will return: Text 2,Text 3
and if I use replace it doesn't work, IE:
test = test.replace(",", ", ");
I thought, this might be an array and tried to convert it to string and still it didn't work!