AJAX call - weird special character problem

I'm using a form_remote_tag with a collection:

<%= select_tag "fields",     options_from_collection_for_select(@fields, :keyname, :keyname),     :multiple => true,     :size => "10"%>

which works fine so far. The content of @fields looks something like this: MC1_OS_CPU_%iowait MC1_OS_CPU_%idle MC1_OS_CPU_%user [...]

When submitting the form with a single value selected from the select field, everything works fine. params:"fields"=>["BCURD01_OS_CPU_ %user"]

But when selecting multiple values, the params look like this: fields"=>["MC1_OS_CPU_%2525idle", "MC1_OS_CPU_%2525iowait", "MC1_OS_CPU_%2525user"]

Notice the 2525s. This only occours with special chars like "%" or "&" inside the values.

Any ideas how to fix this?

Thanks, Thomas

It seems to be a prototype.js issue. The POST request looks as follows: fields%5B%5D=BCURD01_OS_CPU_%252525system&fields%5B%5D=BCURD01_OS_CPU_ %252525user

So looks like it's a bad idea to have %-signs inside the strings. Putting ' ' around the strings didn't help.

But there must be a way to escape them or something?