Options in drop down are not coming correctly, splitting one option into multiple ones


Description

The customer had a field that gets dropdown choices based on the response from a custom script include, and populating through client script.

However, it is seen that few choice names like "ABC, XYZ & PQR" are coming in 3 lines as "ABC" and "XYZ & PQR".

 

Cause

This issue was caused by incorrect implementation on catalog client script and Script include for the catalog item.

In the code, the customer was splitting the return array with ',' delimiter, and putting each part in array object. However, the result set also contains some commas as well. Hence the problem.

Resolution

Try using a different delimiter as '|', instead of ','. Or change the choice values to something, that does not contain a comma.