Let's assume we have an HTML multi-select.
How to prepare an ajax request URL with the selected values from the multi-select. I'm using YUI dataTable, so I do not think I can use form serialization (but would not even want to even if I could)? The URL generated should be the same as with a normal form submission with page refresh.
I did this but was hoping a better way with YUI was possible:
function createURLFromMultiSelect(ob, name) {
var url = "";
for (var i = 0; i < ob.options.length; i++) {
if (ob.options[ i ].selected) {
url += "&" + name + "[]=" + ob.options[ i ].value;
}
}
return url;
}