title: Javascript / JQuery Save value to file
body: <p>I have a few radio buttons in a page and I need to save their values or whatever value is selected to a file.</p>
  
  <p>Here is a sample code:</p>
  
  <pre><code> &lt;input name="select" type="radio" value="a" /&gt;
   &lt;input name="select" type="radio" value="b" /&gt;
   &lt;input name="select" type="radio" value="c" /&gt;
   &lt;input name="select" type="radio" value="d" /&gt;
  </code></pre>
  
  <p>Whenever the user selects one I need it saved / appended into a file.</p>
  
  <p>Possible?</p>
  
  <p>UPDATE:</p>
  
  <p>Tried this:</p>
  
  <pre><code>&lt;script&gt;
    $(document).ready(function () {
  
  $("input[name='select']").change(function(e) {
      e.preventDefault();
      $.post("zzz.html", { selectedValue : $(this).val()  }, function(response) {
          // do something with server response
          alert('saved');
      });
  });
  
  
  
  });
    &lt;/script&gt;
  </code></pre>
  
  <p>Result: No Result. Nothing created / Nothing Saved.</p>