Passing multiple variables with onClick
===

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.

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..

    <HTML>
    <HEAD>
    <TITLE>Test Input </TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    function writeText (var1, var2, var3) {
        form.inputbox1.value = var1
        form.inputbox2.value = var2
        form.inputbox3.value = var3
    }
    </SCRIPT>
    </HEAD>
    <BODY>
    <FORM NAME="myform" ACTION="" METHOD="GET">
    Enter something in the box: <BR>
    <INPUT TYPE="button" NAME="button2" Value="Write" onClick="writeText(this.form)"><br>
    
      <input type="text" name="inputbox2"><br>
      <input type="text" name="inputbox3"><br>
      <input type="text" name="inputbox4">
    
    </FORM>
    </BODY>
    </HTML>