Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Expected Error

Status
Not open for further replies.

jfiers

Programmer
Feb 9, 2008
1
I am trying to do something that should be simple but I am struggling. I am trying to load text boxes with dollars amounts from a database with a total box. If the user changes the numbers in the box I want to retotal. Here is the JavaScript
<script language="JavaScript" type="text/JavaScript"><!--
$(document).ready (function startCalc(){
interval = setInterval("calc()",1);}
function calc(){
one = document.bcraviewaction.firstBox.value;
two = document.bcraviewaction.secondBox.value;
document.bcraviewaction.thirdBox.value = (one * 1) + (two * 1);})
$(document).ready (function stopCalc(){
clearInterval(interval);})
</script>
Here is the text box:
<input type="text" class="right" width="30" maxlength="12" name="firstbox" onFocus="startCalc();" onBlur="stopCalc();" value="dbValue" />
I keep receiving the following error:
Line: 267
Char: 1
Error: Object Expected
Code: 0
URL: myurl.cfm
I would appreciate any advice you can give.
Thanks in advance
 
what is the "$"?? a function/variable?? and "ready"?

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
You're pretty new to this, aren't you, Lowet? That's from the prototype.js library with Scriptaculous.

I would suggest using Firefox to get understandable error messages in their error console.

Lee
 
i didn't know what library he used.. i do my own.. and i also use the $() function to grab an element or it's "relatives" in the DOM.. so, no, i'm not new to javascript. started with it when it came out.. but i'm new to forums..

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top