Skip to content
Advertisement

Choose multiple data from datalist dropdown

I have this datalist, and right now I can only choose a signle variable, and this variable is sent with a form, and used in a sql query. But my users want to be able to pick multiple data from the datalist, but how can this be done? Can it be done by a checkbox for each option or?

Part of the code:

if ($SearchParameterArray[$i]['URL'] == "TSC") {
  echo "<input style='width: 100%;' list='".$SearchParameterArray[$i]['FieldName']."' type='text' name='".$SearchParameterArray[$i]['FieldName']."'  value='".$SearchParameterArray[$i]['InputArray']."' onchange='this.form.submit()' placeholder = '".$SearchParameterArray[$i]['PlaceHolder']."'  autocomplete='off'><br>";
  echo"           
  <datalist id='".$SearchParameterArray[$i]['FieldName']."'";
  foreach($_SESSION['TSC_names'] as $dataRow2)
  {
    echo"<option value='$dataRow2'>";
  }
  echo"</datalist>";
}   

Datalist picture

Advertisement

Answer

Multiple currently working only with input type=”email” and only in Chrome and Opera

Reference: multiple selections with datalist

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement