Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Javascript error in Explorer only. Object not defined.?

I get...

Error: 'document.regform.subtot1' is null or not an object

I also get it in another spot... here's what I'm working with..

<SCRIPT LANGUAGE="JavaScript" type="text/javascript">

interval = setInterval("calc()",1);

function startCalc()

{

interval = setInterval("calc()",1);

}

function calc()

{

one = document.regform.subtot1.value;

two = document.regform.subtot2.value;

three = document.regform.subtot3.value;

document.regform.grandtotal.value = (one * 1) + (two * 1) + (three * 1);

}

function stopCalc()

{

clearInterval(interval);

}

dinner_interval = setInterval("dinner_calc()",1);

function dinner_startCalc()

{

interval_dinner = setInterval("dinner_calc()",1);

}

</script>

It works fine in Firefox, but IE gives an error, and the code does not work. Any ideas? Thanks. I know this is a common IE thing, but I can't find a solution that works for me.

Update:

I changed to document.getElementById('subtot1')

and got rid of that error, but now i get...

Wrong number of arguments or invalid property assignment at this line...

document.getElementById('grandtotal')

= (one * 1) + (two * 1) + (three * 1);

Update 2:

... that also breaks it in Firefox...

3 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    document.getElementById('grandtotal')

    should be

    document.getElementById('grandtotal').value

    You need a better js environment! I use firefox + firebug, it makes little errors easy to fix!

    good luck & good coding!

  • 1 decade ago

    Sounds like you have a worm on your IE. Go through your cookies and see then delete. Get out and do a scan. It should fix it..

  • 4 years ago

    difficulty-free concern to make certain verify out the right of your information superhighway browser and click "approaches"> flow right down to "information superhighway strategies..." > Then verify out the right of that field and choose "stepped forward" >Scroll down until you notice a "Java" Icon(looks like a cup of coffee w/ crimson steam) determine that field is checked) then you definitely would desire to attempt it

Still have questions? Get your answers by asking now.