Please Help!!!

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.
 
M

Michael Winter

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:

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?

Performing a form submission on inputs such as menus and checkboxes is
generally a bad idea. If a user makes a mistake, uses the keyboard for
navigation, or changes their mind about what they selected, they will have
no way to select the right option.

The better idea is to use a button. As you want to execute code upon
submission, you can call it "onclick". As well as avoiding the above
issues, you present an interface that the user will be familiar with.
Clicking a button is associated with performing an action, such as a form
submission. Selecting an item from a menu is not.

Mike
 
G

Grant Wagner

Iyke said:
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.

Yes, I have a couple:

1) use a more descriptive subject then "Please Help!!!", you are more
likely to receive a response to your inquiry

2) don't use the changing of a drop-down menu to trigger the submission
of a form, use a button. Instead of trying to hack around the way the
end-user's UI works, just avoid the problem in the first place

--
| Grant Wagner <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-developer/upgrade_2.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top