cameronlanni
10-22-2005, 08:11 PM
I understand that forms convert to strings, so I need to re-convert back to a number, and then add the amount I want. Then I re-assign the variable to the hidden form, and call it from a frame within the page.
I'm using:
Number(' ');
Now I'm either using it incorrectly, or there's an error somewhere else in the code. It instead adds the two strings together still. Here's what my code looks like:
if (classf == "bonus") {
var maxhp = document.forms[0].elements[4].value
var maxhp = (number(maxhp));
maxhp = maxhp + 15;
document.forms[0].elements[4].value = maxhp;
}
I'm using:
Number(' ');
Now I'm either using it incorrectly, or there's an error somewhere else in the code. It instead adds the two strings together still. Here's what my code looks like:
if (classf == "bonus") {
var maxhp = document.forms[0].elements[4].value
var maxhp = (number(maxhp));
maxhp = maxhp + 15;
document.forms[0].elements[4].value = maxhp;
}