What type of element is #MDataList? I assume it is a form element because that is what val() works for. But keep in mind that val() is primarily used to get values from input form elements like input, select and textarea elements.
Also know that since the input type for MDataList in your form is a text type, the value is going to be passed as a string, not an array. I can’t really say more until you provide more detail about what type of element #MDataList is pointing to. If you want to pass multiple elements, be sure to string them together in a string, submit it through the form and then split the string using PHP. That or possibly look up how to use square brackets with form input names for creating PHP array elements.
It might also help to tell us what framework you are using since you mention controllers.