How to get the array value of php to javascript function from form
<pre><code>$i=1;$j=0;
while($s=mysql_fetch_row($q))
{
echo "&lt;table width=90% bgcolor='#6CDAF5' align=center&gt;
    &lt;tr&gt;&lt;th align=left&gt; Bug $i: &lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Username: &lt;td&gt; $s[0] &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;User email-id: &lt;td&gt;$s[1] &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;User Contact-no :&lt;td&gt;$s[2] &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Bug: &lt;td&gt;&lt;textarea rows=5 cols=40 name=bug[]&gt;$s[3]&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Bug-Reason: &lt;td&gt;&lt;textarea rows=5 cols=40  name=text1[]&gt;$s[4]&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Bug-Solution:&lt;td&gt;&lt;textarea rows=5 cols=40 name=text2[]&gt;$s[5]&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Updated-date:&lt;td&gt;&lt;input type=text value='$s[6]' name=date&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td width=100% align=right colspan=2&gt;&lt;input type=button name=addbug value='add this bug with main bugs'.$i OnClick=validate($i)&gt;&lt;input type=button name=delete value='delete this bug' OnClick=delete()&gt;&lt;/tr&gt;
    &lt;/table&gt;&lt;br&gt;";
    $i++;$j++;

}
</code></pre>

<p>here i changed the textarea name in each and every iteration of while loop.. 
 how to get the textarea value while clicking the button in javascript validate function</p>

<pre><code>function validate(bug1)
{
      document.write(bug1);
      var bug2=document.forms["form1"]["bug[bug1]"].value; 
      document.write(bug2);
}
</code></pre>

<p>I've tried somewhat like this, but I couldn't the textarea value. Can anyone help me?</p>
