timinark Posted October 4, 2005 Posted October 4, 2005 Hi. I am getting a script error when I am adding to cart. MS says: <script LANGUAGE="JavaScript"><!-- function chkstk(frm) { var stk={}; var instk=false; if (frm.attrcomb.type=='select-one') { var attrs=frm.attrcomb.value.split(','); } else { for (i=0; i,frm.attrcomb.length; i++) <<----Here {Length is null or not an object} { if (frm.attrcomb.checked) { var attrs=frm.attrcomb.value.split(','); break; } } } var id=Array(1); for (i=0; i<attrs.length; i++) { id=attrs.split('-')[1]; } if (stk[id[0]]) instk=true; return instk; } function chksel() { var instk=chkstk(document.cart_quantity); if (!instk) alert('The combination of options you have selected is currently out of stock. Please select another combination.'); return instk; } document.cart_quantity.onsubmit=chksel; //--></SCRIPT> I have a stock site less register globals. My attribute type is radio button with one attribute. If this has been covered before I apologize. Thanks Tim Quote
Guest Posted October 4, 2005 Posted October 4, 2005 you need to compare with something in this for loop. for example: for (i=0; i<frm.attrcomb.length; i++) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.