Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable mouse wheel? 6

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
I asked this before but did not get far. How do you prevent the mouse wheel when used for scrolling down a form from rolling down combo values if focus happens to be on one. Thanks
 
In standards compliant browsers (IE might have some sort of option), there is no way of doing this without resorting to JavaScript. However, I think that using mouse wheel on the combo box is a common functionality that most users expect and I for one would not like it if a website would prevent me from using that functionality. What you think is the best for the users is not always what they think is best. A safe bet is letting the user decide. If they want to scroll in combo boxes via mouse wheel, let them, if they don't they won't do it.
 
Thanks. The problem being a user selects a combo, uses his mouse to select a value. They then try and use the wheel to scroll down the page and do not notice in the sequence of clicking back on the form to get focus, that they have amended the combo value!!

If you could direct the focus back to the form after making a combo selection would solve it. I suppose a button could be next to each combo to confirm the selection made, which in turn moves the focus away, don't know. Oh what fun!!

 
Just a thought as an alternative approach. Why not implement a dynamic select. This way once an option was chosen in the select box (regardless of accident or on purpose), you could have confirmation message before the user continues... "Thank you for selecting..."

This way the user knows what they chose before continuing.

Just my 2 cents!

X
 
IMHO, having a confirmation would be even more annoying.

Personally, I learn from my mistakes. Let the users do the same. The first time they submit the wrong values, tell them why. They shouldn't make a habit of it (and if they do, they clearly have no capacity to learn from their mistakes).

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks both of you. I do like Xaqte's thought of a messagebox popping up with an Okay button on it. That would take focus away and confirm what they selected. While they have a mouse in their hand it wouldn't be too much to ask of them, and prevent errors/phonecalls. I have never tried creating a message box before, modal type as well? I do not want to use java if I can help it! Regards
 
You will have to use JavaScript to create a conformation box. It is pretty simple, but plain html has no such capabilities. I still think your best bet is to let it be.
 
Personally, like Dan, I'd say leave it alone. You have more important ways to spend time on your site than obsessing on such details. Pop-up boxes in particular are likely to irritate the bejesus out of your visitors.

If you insist on pusuing this, it should be possible to move the focus to some other part of the form when an option is selected, without any popup being involved. I don't speak Javascript well, but something along these lines...
Code:
<select name="myselect" onchange="document.forms[0].someotherfield.focus()">
Be warned, this may be bad for your site's accessibility, as keyboard users will find it difficult to retain focus on the select box to change it. A lot of people like to use the keyboard to enter forms.

Like I said, best to leave it be.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
A confirmation box?

that would be SO annoying!
would you really not get irritated by that if you were a user rather than the author of the site?

Leave it as it is. If it's really that much of a problem then use radio buttons or something.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
Yep. Just let it be.

I built a simple DB GUI for a client, and fully expected to have a few problems, But all the office staff who had to use it were all aware that if they used the scroll wheel they had to click the page after selecting.

Just seemed like it was only me that had any issue. But then I just build 'em, not use them every day.



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Ok, lets see:

Vragabond, BillyRayPreachersSon, ChrisHunt, Foamcow and ChrisHirst (look at the MVPs list) have all agreed that it is best left alone.

Wonder if their advice is worth listening to.
 
Sorry I did not get back until now. No need to toss coins, and thanks for the overwhelming answers. YOUR ALL WINNERS. If the user is stupid enough to see what he's done then it's up to them. Washing my hands and saying a big thankyou and stars all round. That should brighten the forum up!!
 
Have a confirmation page where you list up all the options the user's selected and ask him to confirm. You can also add some "common reasons for selecting wrong" or the like underneath.
 
Thanks krigbert, good idea. You must have seen the stars, have one on me. Don't know what Foamcow is on but he seems happy!!
 
btw, fyi and all that, and because I like to stir things up...

onmousewheel="return false" in your select tag will do some sort of job for you

Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs(y)<10) && (((parseInt(Math.abs(x).toString()+Math.abs(y).toString())-Math.abs(x)-Math.abs(y))%9)!=0)) {alert(&quot;I'm a monkey's uncle&quot;);}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top