title: How do i add a placeholder to a Multiselect form field on mobile devices
body: <p>I'm using Code Ignitor to generate a multiselect form using the form_multiselect() function. I don't however believe this issue is specific to CI, rather the way that mobile browsers render multiselect form fields.</p>
  
  <p>My form code:</p>
  
  <pre><code>&lt;div id="searchform" class="search search-form search-horizontal"&gt;
      &lt;?php
      $detectselect = isset($selecteddetec) ? $selecteddetec : '';
      $gasselect = isset($selectedgases) ? $selectedgases : array();
      echo form_open('searchproduct', array('name' =&gt; 'contact', 'class' =&gt; 'searchproduct'));
      echo ('&lt;div class="boxes"&gt;');
      echo form_label('Type of detector', 'typeofdetect');
      echo form_dropdown('typeofdetect', $detecttype, $detectselect);
      echo ('&lt;/div&gt;');
      echo ('&lt;div class="boxes"&gt;');
      echo form_label('Gases to detect', 'gastodetect[]');
      echo form_multiselect('gastodetect[]', $gasdetectopt, $gasselect, 'class="gas-multiselect" placeholder="Choose gases..."');
      echo ('&lt;/div&gt;');
      echo form_hidden(array('posturi' =&gt; $pgalias));
      echo form_submit('submit', 'Search', "class='buttons'");
      ?&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>On a desktop browser, the form has the Chosen jQuery library applied which in turn handles the placeholders for the fields, these work correctly. </p>
  
  <p>On mobile devices the Chosen library is disabled so normal form markup is used. The placeholder for the single select field works as expected however the multiselect displays '0 Selected' by default and nothing i do seems to change that.</p>
  
  <p>Does anyone have any experience with overriding it? passing a placeholder attribute through the form_multiselect() function makes no difference, and I can't find any answers online. We need a placeholder as on mobile devices we have no form labels (and due to space in the display, we would really rather avoid them)</p>
  
  <p>Edit:: Screenshot of the issue</p>
  
  <p><a href="https://i.stack.imgur.com/Q9FAi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q9FAi.png" alt="enter image description here"></a></p>
  
  <p>Edit 2::</p>
  
  <p>I have accepted Dray's answer below, for completeness this is what i needed to pass into the options array in code ignitor.</p>
  
  <pre><code>$a['0" default selected disabled="disabled'] = 'Choose gases...';
  </code></pre>