Results 1 to 7 of 7

Thread: Can't make a sum of array

  1. #1
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can't make a sum of array

    Code:
    function refresh_item()
    {
    boxes = document.creatureedit.npcflag.length;
    var get_item = '';
    for (i = 0; i < boxes; i++) {
    if (document.creatureedit.npcflag[i].checked) {
    get_item = get_item += document.creatureedit.npcflag[i].value;
    }
    }
    alert(get_item);
    if (opener.document.forms['creatureedit'].npcflag.value)
    {
    opener.document.forms['creatureedit'].npcflag.value = get_item;
    }
    opener.focus();
    window.close();
    }
    Hi i just spending this afternoon for this i cant get the som of npcflag
    Last edited by mgameulstee; 09-17-2006 at 08:37 PM.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    私達はmgameulsteeをわかりません。英語を話して下さい。
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry forgot it was a english forum

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    mdfioVHJ EJKLfh VKLJErhm3n4i12jo3ij190!!
    - Mike

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I think what he ment to imply was that we're not clear on the question
    - Mike

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Sorry forgot it was a english forum
    Lol, no problem.
    Code:
    function refresh_item()
    {
      var a = document.forms['creatureedit'].elements['npcflag'],
        b = 0,
        i;
      for (i = 0; i < a.length; ++i)
        if (a[i].checked)
          b += parseFloat(a[i].value);
      if (typeof (a = window.opener.document.forms['creatureedit'].elements['npcflag']).value !== "undefined")
        a.value = b;
      window.opener.focus();
      window.close();
    }
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you so much that work
    Last edited by mgameulstee; 09-17-2006 at 09:01 PM.

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
  •