Form Field - Multiple Selection - The PHP Mailer collects me only one of the several values that you select

1

I want to consult whoever corresponds, something that should have a solution. It turns out that I have a form with several text fields, other so many of simple selection and a field of multiple selection. Using select2.

The data of the completed forms is collected by PHPMailer. each field has a name="....." value, and everything is fine, except that in the multiple-selection field only a single value of the selected ones is taken, the last one,

The PHP Mailer reads like this

    $message .= "<tr><td><strong>|Barcos|</strong> </td><td>" . s trip_tags($params['user-barcos']) . "</td></tr>";

The html form

asi

<select multiple="multiple" class="js-example-placeholder-multiple form-control" name="user-prestadores" id="user-prestadores" data-toggle="tooltip" title="Puedes comenzar a escribir la que buscas o seleccionar del listado. Es opcional">
<optgroup label="Delta">
<option value="Bote">Bote</option>
<option value="lancha">lancha</option>
<option value="Velero">Velero</option>
<option value="Crucero">Crucero</option>
</select>
    
asked by Hernan527 03.12.2018 в 05:12
source

1 answer

0

In case anyone can help, I solved it like this

$ message.="options:". (isset ($ _ POST ['options'])? implode (",", array_map ("htmlspecialchars", $ _POST ['options'])): "not selected"). ""; "; // Multimple select box

    
answered by 09.12.2018 в 09:55