A million thanks if anyone can help me figure this out. I've been banging my head against the screen trying to solve it. It's probably the stupidest of errors, but I'm just not finding it. The goal is to have a number on the screen go down or up as elements in a form are selected or deselected. One version of the script and form works just fine (in Firefox anyway). The other (much longer) version does not work; the number ("15") just sits there, not changing. Here's the complete code I'm working with. Sorry if it's verbose, but the error must be in there somewhere. <P><B>THIS ONE UPDATES THE SUM AS YOU GO:</B></P> <form name="form1" > <script type="text/javascript"><!-- function update() { document.form1.somesum01.value = (10) - (document.form1.sum1.value) - (document.form1.sum2.value) - (document.form1.sum03.value); } //--></script> The sum is: <input name="somesum01" readonly value="10" style="border:0px;"> <BR /><BR /> Enter a number: <input name="sum1" onChange="update()" /> and another number: <input name="sum2" onChange="update()" /> and then this: <select name="sum03" onChange="update()" /> <option selected></option> <option>1</option> <option>2</option> <option>3</option> </select> </form> <P><B>THIS ONE DOES NOT UPDATE THE SUM AS YOU GO:</B></P> <form name="form2"> <script type="text/javascript"><!-- function updatesum03() { document.form2.sum03.value = (15) - (document.form2.attacks03.value) - (document.form2.defends03.value) - (document.form2.useful103.value) - (document.form2.useful203.value) - (document.form2.useful303.value) - (document.form2.useful403.value) - (document.form2.area03.value) - (document.form2.awesome03.value) - (document.form2.burn03.value) - (document.form2.gnarly03.value) - (document.form2.sharing03.value) - (document.form2.spray03.value) - (document.form2.tough03.value) - (document.form2.wickedfast03.value); } //--></script> <P><b><font size=+1>Body</font></b><BR><i>Locations:</i> 5, 6, 7 </P> <P><b>Dice Available for Body Powers:</b> <input name="sum03" value="15" readonly style="border:0px;"></p> <P><b><font size=+1>Can this monster part attack and destroy things? (Check if yes.)</font></b> <input name="attacks03" type="checkbox" value="1" onClick="updatesum03()" /> <P><b><font size=+1>Can this monster part defend and protect the monster? (Check if yes.)</font></b> <input name="defends03" type="checkbox" value="1" onClick="updatesum03()" /> <P><b><font size=+1>Does this monster part have some other useful ability or power? (Check if yes.)</font></b> <input name="useful103" type="checkbox" value="1" onClick="updatesum03()" /> <P>Describe it: <input name="usefulness103" type="text" size="36" /> <P>Does this special ability let the monster lift heavy things, or affect things at a distance, or move extra fast? (Choose one.)<br> <input name="capacity103" type="radio" value="mass" /> Lift things . . . <input name="capacity103" type="radio" value="range" /> Affect things at a distance . . . <input name="capacity103" type="radio" value="speed" /> Move fast <P><b><font size=+1>Does this monster part have a second other useful ability or power? Check if yes.)</font></b> <input name=useful203 type="checkbox" value="1" onClick="updatesum03()" /> <P>Describe it: <input name="usefulness203" type="text" size="36" /> <P>Does this special ability let the monster lift heavy things, or affect things at a distance, or move extra fast? (Choose one.)<br> <input name="capacity203" type="radio" value="mass" /> Lift things . . . <input name="capacity203" type="radio" value="range" /> Affect things at a distance . . . <input name="capacity203" type="radio" value="speed" /> Move fast <P><b><font size=+1>Does this monster part have a third other useful ability or power? (Wow!) (Check if yes.)</font></b> <input name="useful303" type="checkbox" value="1" onClick="updatesum03()" /> <P>Describe it: <input name="usefulness303" type="text" size="36" /> <P>Does this special ability let the monster lift heavy things, or affect things at a distance, or move extra fast? (Choose one.)<br> <input name="capacity303" type="radio" value="mass" /> Lift things . . . <input name="capacity303" type="radio" value="range" /> Affect things at a distance . . . <input name="capacity303" type="radio" value="speed" /> Move fast <P><b><font size=+1>Does this monster part have a fourth other useful ability or power? (What, are you kidding me?!) (Check if it does.)</font></b> <input name="useful403" type="checkbox" value="1" onClick="updatesum03()" /> <P>Describe it: <input name="usefulness403" type="text" size="36" /> <P>Does this special ability let the monster lift heavy things, or affect things at a distance, or move extra fast? (Choose one.)<br> <input name="capacity403" type="radio" value="mass" /> Lift things . . . <input name="capacity403" type="radio" value="range" /> Affect things at a distance . . . <input name="capacity403" type="radio" value="speed" /> Move fast <P><b><font size=+1>Which Extras does this monster part have (if any)?</font></b></P> <p><b>Area</b> <br><i>When you use it, things blow up. The bigger the number, the more dangerous the blast.</i></p> <select name="area03" onChange="updatesum03()"> <option selected></option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select> <p><b>Awesome</b> <br><I>With one level of Awesome, you can set any die in the monster part to any value you want before rolling the rest. With two levels of Awesome, you can set any die in the monster part to any value you want AFTER rolling the rest.</I></p> <select name="awesome03" onChange="updatesum03()"> <option selected></option> <option>1</option> <option>2</option> </select> <P><B>Gnarly</b> <BR><i>For a monster part that can attack things. It does more damage than usual.</i></p> <select name="gnarly03" onChange="updatesum03()"> <option selected></option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select> <P><B>Tough</b> <BR><i>The monster part ignores a certain amount of damage from each attack against it.</i></p> <select name="tough03" onChange="updatesum03()"> <option selected></option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select> <P><B>Wicked Fast</b> <BR><i>The monster part usually goes before anybody else can act.</i></p> <select name="wickedfast03" onChange="updatesum03()"> <option selected></option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select> </form> <P><B>Burn</b> <BR><I>It sets things on fire!</i></p> <input name="burn03" type="checkbox" value="1" onClick="updatesum03()" /> <P><B>Sharing</b> <BR><I>The monster can let its kid use this monster part's powers.</i></p> <input name="sharing03" type="checkbox" value="1" onClick="updatesum03()" /> <P><B>Spray</b> <BR><I>The monster part can use any and all sets of matching dice that it rolls, not just one.</i></p> <input name="spray03" type="checkbox" value="1" onClick="updatesum03()" /> </form> Code (markup): Help!
You're going to :headdesk: when I tell you this. Okay, you ready? You closed your form2 tag after the "Wicked Fast" part by accident so "Burn" and "Spray" were not included in the form which was throwing errors of "document.form2.burn03 is undefined" and "document.form2.spray03 is undefined" Want to spot errors like this easily in Firefox? Get firebug! By the way, how is the top one "The sum" when you're subtracting? That would be "The difference"
:headdesk: Thank you! Yes, it should be "difference." And I'll need to tweak the way the check boxes work, because they don't quite do things right. But at least that number 15 is changing now! Installing Firebug now.