PDA

View Full Version : Can't make a sum of array



mgameulstee
09-17-2006, 08:23 PM
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

Twey
09-17-2006, 08:34 PM
私達はmgameulsteeをわかりません。英語を話して下さい。

mgameulstee
09-17-2006, 08:44 PM
Sorry forgot it was a english forum

mburt
09-17-2006, 08:44 PM
mdfioVHJ EJKLfh VKLJErhm3n4i12jo3ij190!!

mburt
09-17-2006, 08:46 PM
I think what he ment to imply was that we're not clear on the question :)

Twey
09-17-2006, 08:48 PM
Sorry forgot it was a english forumLol, no problem.
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();
}

mgameulstee
09-17-2006, 08:56 PM
Thank you so much that work