title: Fill input field, with twig value using jquery
body: <p>I've been searching for a while with no luck.</p>
  
  <p>I know my question looks mundane, and it has plenty (as in hundreds) of answers out in google and here, yet, still my problem seems far from solved.</p>
  
  <p>I have the following problem, I need to fill an input field, with a value from silex variables in a twig file.</p>
  
  <p>the form is as follows:</p>
  
  <pre><code>&lt;span&gt;Author: &lt;/span&gt;
  &lt;input type="text" name="author" id="author" 
  {% if user.getAuthorName %}value="{{user.getAuthorName}}"{% endif %} /&gt;
  &lt;span&gt;&lt;a href="#" id="filler"&gt;Use your own username&lt;/a&gt;&lt;/span&gt;
  </code></pre>
  
  <p>and the js code is:</p>
  
  <pre><code>&lt;script&gt;
    $(function(){
      $('#filler').live('click', function() {
        $("#author").val($("#author").text("{{user.getFirstName}} {{user.getLastName}}"));
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>the problem I'm having is, the code actually works, yet still, when i click, it fills the field with</p>
  
  <pre><code>[object Object]
  </code></pre>
  
  <p>instead of the actual value of the 2 variables</p>
  
  <p>I've tried changing it to a hidden field with an id, and setting the variables as value, and using
       .text($("#idfield").val())</p>
  
  <p>still no luck, still fills the values with </p>
  
  <pre><code>[object Object]
  </code></pre>
  
  <p>has any of you any idea what I'm doing wrong here?</p>