Html Comment Box Script

By admin  

html comment box script
html form not working with javascript function?

I built this code myself its suppost to take a user input value and run the function and spit the number back out but every time I try and run it I get a error code from line 40 (IE6), saying that the object does not support that atribute, but I know it does. I numbered the lines at the comment boxes.
function:

form:

Minister level to obtain:
(line 40)

I just want to know why its not working and what I can do to fix it.

the value property of a text box is valid, but i suspect lvltoget is not referencing the textbox properly with this code.

my advise -
first, use an ID attribute in place of or in addition to the name attribute for your textbox:

then, in your function, use the getElementById method to get your object.
var lvltoget = document .getElementById(“lvltoget”) .value
lastly i would use a for loop instead.
for (var lvl = 2; lvl < lvltoget; lvl++)
{
...
cost += (lvl*1000)
}

Facebook HTML Box



Post a Comment

Your email is never shared. Required fields are marked *

*
*