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: <script language="JavaScript"> <!-- var cost = 0; var lvl = 2; function ministercalc() { var lvltoget = window.document.ministercalc.lvltoget.value; while (lvl < lvltoget) { window.document.write ("working... " + lvl); cost = cost + (1000*lvl); lvl = lvl + 1; } window.document.write ("Total cost is: " + cost); } // --> </script> form: <div id="body"> <form name="ministercalc" action=''> Minister level to obtain:<br /> (line 40)<input type="text" name="lvltoget" value="" /> <br /> <input type="button" value="Run" onClick="ministercalc();" /> </form> I just want to know why its not working and what I can do to fix it.