Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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

Posted

you need to compare with something in this for loop.

 

for example:

for (i=0; i<frm.attrcomb.length; i++)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...