title: how to set form value with external select value
body: <p>so i am using the play framework and I'm try to create multiple submit buttons that call the one form:</p>
  
  <p>So what I have is a list of strings, and i would like to create two buttons that will go back to the server and complete an event, the first is send the second is cancel. What i would like to also do is set the source value equal to what is selected in the foo select object. How would I go about doing this? Do i need to create a javascript even that is fired from the form and then get the var inside that function and then fire off the submit? Im not 100% familiar with play framework and scala, so im not sure if i can get it somehow inside this code without using a new method.</p>
  
  <pre><code>@(myList: List[String], theForm: Form[Obj])
  @import helper._
  @main("myVar Controller") {
  
  &lt;select id="foo"&gt;
  &lt;/select&gt;
  
  &lt;table border="1"&gt;
      &lt;tr&gt;
      @for(myVar &lt;- myList) {
          &lt;td&gt;@myVar
          @form(routes.Application.method()) {
          &lt;div id="hiddenForm" style="visibility:hidden"&gt;
              &lt;input type="text" name="commandID" id="commandID" value="10" /&gt;    //Send Code
              &lt;input type="text" name="source" id="source" value=**"Put selected value of foo here" /&gt;**
              &lt;input type="text" name="destination" id="destination" value="@myVar" /&gt;
          &lt;/div&gt;
          &lt;input type="submit" value="Send" /&gt;
          }
          @form(routes.Application.method()) {
          &lt;div id="hiddenForm" style="visibility:hidden"&gt;
              &lt;input type="text" name="commandID" id="commandID" value="18" /&gt;    //Undo code
              &lt;input type="text" name="source" id="source" value=**"Put selected value of foo here" /&gt;**
              &lt;input type="text" name="destination" id="destination" value="@myVar" /&gt;
          &lt;/div&gt;
          &lt;input type="submit" value="Undo" /&gt;
          }
          &lt;/td&gt;
      }
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>}</p>