title: Javascript - concatenate field value to onclick button link?
body: <p>I have an issue I need to fix on an existing app that I didn't initially write. Here is a snippet of code that doesn't do what it is intended to do. What it is supposed to do is take the value of the field and upon clicking "Search", append that to the redirection to pass in the querystring to the destination page:</p>
  
  <pre><code>&lt;form name="frm_someform"&gt;
      &lt;input type="text" name="f_date" id="f_date"/&gt;
      &lt;input type="button" value="Search" onclick="parent.location='runreport.asp?date=' + document.frm_someform.elements['f_date'].value); + '"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Now, as you javascript folks can plainly see, the concatenation doesn't work. I've searched high and low for how to properly concatenate, but something isn't translating correctly (in my head). Note that if I take out the concatenation, the redirection works fine, so there is something with that causing the issue. Yes, of course in the example above, I could simply make the form submit the proper value with a real 'submit' button, but I have whittled the code down here for simplicity - it is much more complex than the example I have above.</p>
  
  <p>(<em>*Note, I successfully tested concatenation through other javascript functions, but the possibility exists that the purely inline code must be different</em>)</p>
  
  <p>Thanks in advance,
  Beems</p>