Jump to content
Sign in to follow this  
timinark

Scrip Error

Recommended Posts

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

Share this post


Link to post
Share on other sites

you need to compare with something in this for loop.

 

for example:

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

Share this post


Link to post
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
Sign in to follow this  

×