Javascript: Need help to display a variable in a textbox
<p>Upon the click of a button I need to display the appropriate variable to a specific text-box. I've set the variables up in an array so when the user clicks the "Input" button a prompt will appear and ask four questions (1 per each column). </p>

<p>I've attempted to display each prompt with a text box. That's where my problem occurs. Thanks!</p>

<pre><code>&lt;html&gt;
&lt;head&gt;&lt;/head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;script type="text/javascript"&gt;
function buttonMsg() {
    varData = new Array()

    varData[0] = prompt("Please enter first name.","")
    varData[1] = prompt("Please enter last name.","")
    varData[2] = prompt("Please enter phone number.","")
    varData[3] = prompt("Please enter address.","")
}
&lt;/script&gt;
&lt;body&gt;
 &lt;table border="1"&gt;
  &lt;tr&gt;
    &lt;td&gt;0,0 CustomerID&lt;/td&gt;
    &lt;td&gt;1 FirstName &lt;/td&gt;
    &lt;td&gt;2 LastName &lt;/td&gt;
    &lt;td&gt;3 Phone &lt;/td&gt;
    &lt;td&gt;4 Address &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;        
    &lt;td&gt;1 Customer1 &lt;input type="button" value="Input" onclick="buttonMsg()" /&gt;    &lt;/td&gt;       
    &lt;td&gt;&lt;INPUT TYPE="text" NAME="inputbox" VALUE="varData[1]"&gt;&lt;/td&gt;
    &lt;td&gt;&lt;INPUT TYPE="text" NAME="inputbox" VALUE="varData[1]"&gt;&lt;/td&gt;
    &lt;td&gt;&lt;INPUT TYPE="text" NAME="inputbox" VALUE="varData[2]"&gt;&lt;/td&gt;
    &lt;td&gt;&lt;INPUT TYPE="text" NAME="inputbox" VALUE="varData[3]"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;        
    &lt;td&gt;2 Customer2 &lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;3 Customer3&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;4 Customer4 &lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
 &lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
