title: Select_tag rails, display value dynamically before submit
body: <p>I have a form showing some available banks I can choose, using a select_tag.
  The selected bank is stored in params[:bank] when I submit the form</p>
  
  <p>What I want to do is to dynamically show information about the selected bank before submitting. Basically, if I chose "Bank 1", I want to display bank 1 information. If I select Bank 2, I want to display bank 2 information. And when I am happy, I submit.</p>
  
  <p>Here is my code</p>
  
  <pre><code>&lt;%= form_tag final_payments_path, method: :get do %&gt;
  
    &lt;%= select_tag "bank", options_from_collection_for_select(Bank.active, "id", "name") %&gt;
  
    &lt;%= button_tag( class: "btn-continue-displayed mt-3") do %&gt;
     &lt;i class="fas fa-caret-left"&gt;&lt;/i&gt;&lt;p&gt;Approve&lt;/p&gt;
    &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>How can I dynamically find the selected option before submitting and display the information?</p>
  
  <p>My first step was to add onchange: "alert(this.value)" on my select tag. It works and shows the id. If I change and put</p>
  
  <pre><code> options_from_collection_for_select(Bank.active, "IBAN", "name")
  </code></pre>
  
  <p>it shows an alert with the IBAN. Which is a good start. </p>
  
  <p>Is there a way I can put 3 elements (id, IBAN and SWIFT) in the value instead of only one?</p>
  
  <p>Thanks a lot for your help</p>