Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: (none)


Message #1 by "Isaac Sogunro" <ilatine@h...> on Fri, 16 Feb 2001 14:11:44 -0500
Hello.

I was playing around with javascript because I am new and I got the 
following error message:  Syntax Error: Line 19.

I was trying to put place in the first cell of each row the elements in 
ArrTest array.

I just could not figure out what was wrong.  Could someone help me.

-Isaaac-


<html>
<head><title>Example</title></head>

<script language = javascript>
var ArrTest = new Array(5);

ArrTest[0] = "Isaac";
ArrTest[1] = "Sarah";
ArrTest[2] = "Mike";
ArrTest[3] = "Henrietta";
ArrTest[4] = "Helen";

function button1_onclick()
{
var i;

   for(i=0; i<=5; i++)
   {
       document.name + "i" = ArrTest[i]; //This is line 19.
   }
}
</script>

<body>
<table cellpadding=1 cellspacing=1 border=1 width="100%" borderColor=orange>
<tr>
   <td><input type=text name=put1 value="hey"></td>
   <td></td>
</tr>

<tr>
   <td><input type=text name=put2 value="hey"></td>
   <td></td>
</tr>

<tr>
   <td><input type=text name=put3 value="hey"></td>
   <td></td>
</tr>

<tr>
   <td><input type=text name=put4 value="hey"></td>
   <td></td>
</tr>

<tr>
   <td><input type=text name=put5 value="hey"></td>
   <td></td>
</tr>
</table>
<INPUT type=button name=button1 value="Click Me"
language=javascript onclick="return button1_onclick()">
</body>
</html>



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


  Return to Index