title: Passing multiple variables with onClick
body: <p>I am wanting many different buttons (each written in using PHP), to pass 3 or more variables using onClick to the function to then write this into the input fields.</p>
  
  <p>The following is getting close, but I am not sure how to pass up the multiple var array up to the function for the re-write..</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;HEAD&gt;
  &lt;TITLE&gt;Test Input &lt;/TITLE&gt;
  &lt;SCRIPT LANGUAGE="JavaScript"&gt;
  function writeText (var1, var2, var3) {
      form.inputbox1.value = var1
      form.inputbox2.value = var2
      form.inputbox3.value = var3
  }
  &lt;/SCRIPT&gt;
  &lt;/HEAD&gt;
  &lt;BODY&gt;
  &lt;FORM NAME="myform" ACTION="" METHOD="GET"&gt;
  Enter something in the box: &lt;BR&gt;
  &lt;INPUT TYPE="button" NAME="button2" Value="Write" onClick="writeText(this.form)"&gt;&lt;br&gt;
  
    &lt;input type="text" name="inputbox2"&gt;&lt;br&gt;
    &lt;input type="text" name="inputbox3"&gt;&lt;br&gt;
    &lt;input type="text" name="inputbox4"&gt;
  
  &lt;/FORM&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>