SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: array problems?

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    array problems?

    This code seems like it should work - can't find the problem:

    Here's the code:

    <!--Generate New Code JavaScript-->
    <script language="JavaScript">

    //Variables
    var check = new Array();
    var scroll, location, tool, status, menu, resize;

    function newCode() {

    //populate array for checkboxes
    check[0] = document.form.scroll.checked;
    check[1] = document.form.location.checked;
    check[2] = document.form.tool.checked;
    check[3] = document.form.status.checked;
    check[4] = document.form.menu.checked;
    check[5] = document.form.resize.checked;

    for (i=0;i<=5;++i)
    {
    if (check[i]==false)
    {
    check[i]="no";
    }
    else
    {
    check[i]="yes";
    }
    }

    //populate variables
    scroll=check[0];
    location=check[1];
    tool=check[2];
    status=check[3];
    menu=check[4];
    resize=check[5];


    --Then I am going to write out the variables above.
    Any advice?

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should be i++


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •