[email protected] Posted April 21, 2011 Share Posted April 21, 2011 I get error:"Object required" Code 0 (in IE8)"Error: document.getElementById("buy_block") is nullSource 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 More sharing options...
[email protected] Posted April 25, 2011 Author Share Posted April 25, 2011 Thanks, but I still get same error right at beginning of your suggested line, and evin if I do a conditional for null or evenif (document.getElementById(‘buy_block’).group_3.value) ...to check if defined. Link to comment Share on other sites More sharing options...
[email protected] Posted April 25, 2011 Author Share Posted April 25, 2011 Yes, I said the FireFox error:“Error: document.getElementById(“buy_block”) is nullSource 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now