title: How I change a value of hidden file according which radio selected
body: <p>I have in a <code>file HTML.twig</code>:</p>
  
  <p>1- a hidden file should take 3 values according which radio selected, one from my database and two others hiden files values the number 10, like this:</p>
  
  <pre><code>&lt;input type="hidden" name="lt" value="{{ price.getLt }}"&gt;
  &lt;input type="hidden" name="lt" value="10"&gt;
  &lt;input type="hidden" name="lt" value="10"&gt;
  </code></pre>
  
  <p>2- And I have 3 radioBox:</p>
  
  <pre><code>&lt;input id="spa-price" name="price" class="w3-radio" value="Spare {{ price.getSparePrice }}" type="radio"&gt;
  &lt;input id="rep-price" name="price" class="w3-radio" value="Repair{{ price.getRepairPrice }}" type="radio"&gt;
  &lt;input id="rep-price" name="price" class="w3-radio" value="Test {{ price.getTestPrice }}" type="radio"&gt;
  </code></pre>
  
  <p>3- I did a block Javascript in the same file <code>HTML.Twig</code>
  I created a function to get the value of each radio:</p>
  
  <pre><code>{% block javasc %}
  &lt;script&gt;
          function valueLt(){
            var spare= document.getElementById('spa-price');
            var repair= document.getElementById('rep-price');
            var test= document.getElementById('tes-price');
  
            if (repair.checked){ // Should take the value 10
                alert("repair checked");
                //&lt;input type="hidden" name="lt" value="10"&gt;
  
            } else if (test.checked){ // Should take the value 10
               alert("test checked");
               //&lt;input type="hidden" name="lt" value="10"&gt;
  
            } else {
               alert("spare checked"); // should take the value from DB
              // &lt;input type="hidden" name="lt" value="{{ price.getLt }}"&gt;
          }
       &lt;/script&gt;
  {% endblock %}
  </code></pre>
  
  <p>Can you tell me how I change the value of my hidden file according each radio selected in the function ?
  Thank you.</p>