I
Iyke
I am having a mouse scroll wheel problem with my select drop downs.
whenever a user uses the scroll wheel to adjust the quatity of items
is a cart, I currently use the onChange() function to submit the form
to a JavaCode that updates my cart. This breaks my code when the user
scrolls quickly with the wheel. I am trying to submit the Form only
ones using a javascript function. So onChange(), I call the follwing
function:
function changing(){
newCount = 0;
SubmitCount++;//global variable
newCount = SubmitCount;
this.setTimeout("submitForm(newCount)", 1000);
}
function submitForm(nc){
if (nc == SubmitCount){
document.cart.submit();
}
}
I was hoping the setTimeout function will act as wait() or sleep(),
and that each change with the scroll wheel will increase the
SubmitCount variable and set newCount to SubmitCount, so whenever a
change wakes up from the setTimeout function, newCount will not equal
submitCount. The only time they should be equal is with the last
change sent to the function. But this does not work well because
newCount for the first request and last request are always identical.
Does anyone have any suggestions?
Thanks..
Iyke.
whenever a user uses the scroll wheel to adjust the quatity of items
is a cart, I currently use the onChange() function to submit the form
to a JavaCode that updates my cart. This breaks my code when the user
scrolls quickly with the wheel. I am trying to submit the Form only
ones using a javascript function. So onChange(), I call the follwing
function:
function changing(){
newCount = 0;
SubmitCount++;//global variable
newCount = SubmitCount;
this.setTimeout("submitForm(newCount)", 1000);
}
function submitForm(nc){
if (nc == SubmitCount){
document.cart.submit();
}
}
I was hoping the setTimeout function will act as wait() or sleep(),
and that each change with the scroll wheel will increase the
SubmitCount variable and set newCount to SubmitCount, so whenever a
change wakes up from the setTimeout function, newCount will not equal
submitCount. The only time they should be equal is with the last
change sent to the function. But this does not work well because
newCount for the first request and last request are always identical.
Does anyone have any suggestions?
Thanks..
Iyke.