title: Multiple select2 form-fields with different placeholders in symfony forms
body: <p>I am having difficulty creating different placeholders for each form field that work with Select2. My first placeholder is also displayed on any consecutive field, which should have it's own placeholder. A similar question might have been <a href="https://stackoverflow.com/questions/21072525/how-to-have-differents-placeholders-with-two-select2">asked before</a>, although I do not completely understand that question, nor does it have an answer. </p>
  
  <p><strong>What I have so far</strong></p>
  
  <p>On my file <code>base.html.twig</code> I included the script of Select2 and have created these few lines of code:</p>
  
  <pre><code>&lt;script&gt;
      $('select[data-select="true"]').select2({
          placeholder: $('select[data-select="true"]').attr("data-placeholder")
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>In my FormType file, in the form builder I have:</p>
  
  <pre><code>-&gt;add('firstEntity', EntityType::class, [
      'class' =&gt; firstEntity::class,
      'multiple' =&gt; true,
      'attr' =&gt; ['data-select' =&gt; 'true', 'data-placeholder' =&gt; 'first placeholder'] 
  ])
  -&gt;add('secondEntity', EntityType::class, [
      'class' =&gt; secondEntity::class,
      'multiple' =&gt; true,
      'attr' =&gt; ['data-select' =&gt; 'true', 'data-placeholder' =&gt; 'second placeholder'] 
  ])
  </code></pre>
  
  <p>The problem is that in a form with two fields like above, the first placeholder is displayed in both fields. So <code>'first placeholder'</code> will be the placeholder for both fields instead of both fields having their own. </p>
  
  <p><strong>My question:</strong> how can I have individual placeholders for each Select2 form field? </p>