How do I save a multi-select HTML form element using the API?
Curl example:
curl -u ‘email:token’ -X PUT -H ‘Content-Type: application/xml’ -d ‘
In this example, we’re selecting both Twitter and Facebook label options for the custom multi-select field in our system.
PHP Example:
-
In the HTML form post the multiple values for the element as a single array by adding a set of square brackets to the form element’s name e.g. name=”myCustomField[]”
-
In the PHP script convert the posted array to a comma delimited string e.g. $fieldValueToSendToSolve = implode(‘, ‘, $_GET[‘myCustomField’]);
-
In the PHP script save the variable containing the comma delimited string as the Solve multi-select field value