Jump to content

Javascript null error


tech@designsbylyn.com

Recommended Posts

I get error:
"Object required" Code 0 (in IE8)

"Error: document.getElementById("buy_block") is null
Source File: http://alacartedancewear.com/themes/crystals/js/product.js" (in Firefox)

from the following code (right after the first { ):

function updateBeltSelect(id_attribute)
{belton=document.getElementById('buy_block').group_3.value;
if (belton == 21) $("#group_3").val(id_attribute);
else $("#group_3").val('(no belt)');
}



I know the value starts out as null, and I have defined belton. Not sure how to deal with it because I check for null value and still get same error.

Link to comment
Share on other sites

Yes, I said the FireFox error:
“Error: document.getElementById(“buy_block”) is null
Source File: http://alacartedancewear.com/themes/crystals/js/product.js” (in Firefox)

I agree, also, and I have worked around it, given that the first time the function gets called with a conditional on the passed value I avoid referencing it altogether. Works great now. Thanks for your help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...