October CMS Magic Forms how to catch multi select values

It's possible you just need to make minor adjustments with the select name.

As when you select multiple items it becomes an array. to represent the array on the HTML side you need to add [] square braces to the name.

Suppose your current select name is tech So your select name becomes tech[] as now we are representing multiple values so it becomes an array.

<select required multiple id="tech" name="tech[]">
<!--                     USE name like THIS ^ -->
  <option value="HTML">
    HTML
  </option>
  <option value="CSS">
    CSS
  </option>
  <option value="JavaScript">
    JavaScript
  </option>
  <option value="Node.js">
    Node.js
  </option>
</select>

It will work and in backend records, it will show something like this :

magic-form-record-list

You can also check other types of Magic Forms such as empty ajax form, generic ajax form and upload ajax form.

js interview questions