title: Javascript function anchor onclick syntax
body: <p>I had following script for comment system working nicely until I put parameters into function call.  Now instead of the function executing, it just reloads the page and bumps me up to the top.  (Before, I had it not bumping and nicely inserting box.)  Can anyone see error in following.  Note, I gather that # is not preferred way to call functions from link, but other ways seemed rather complicated for this simple function call.  Many thanks.</p>
  
  <p>Note thispage is a text string ie "comments.php" while id and topicid are integers.</p>
  
  <pre><code>&lt;script&gt;
  function showReplyBox(id,topicid,thispage) {
      var replybox = '&lt;form action = "newcomment.php" method = "post"&gt;&lt;input type="hidden" name="comid" value="';
  replybox = replybox+ id + '"&gt;';
  replybox = replybox + '&lt;input type="hidden" name="topicid" value="';
  replybox = replybox + topicid + '"&gt;';
  replybox = replybox + '&lt;input type="hidden" name="thispage" value="';
  replybox = replybox + thispage + '"&gt;';
  replybox = replybox + '&lt;textarea autofocus placeholder="Reply to comment" id="replyarea" rows=1 cols=72&gt;&lt;/textarea&gt;&lt;br&gt;&lt;button&gt;Reply&lt;/button&gt;&lt;/form&gt;';
      var empty = ""; 
  
  document.getElementById('replybox').innerHTML = replybox;
  }
  &lt;/script&gt;
  &lt;body&gt;
  //link to call function
  &lt;a href="#" onclick="showReplyBox(44,142,'comments.php');return false"&gt;Reply&lt;/a
  
  //box inserted here
  &lt;div id="replybox"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>