Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi all,

I have a radio button list in my asp.net user control. If user accidentally press any arrow key or space bar, the index of the radio buttons is changed in unexpected way. Hence I need to prevent radio button index being changed at all.

Please suggest how should I achieve that?

Thanks in advance.
Posted
Updated 15-May-13 19:09pm
v2
Comments
Thanks7872 16-May-13 0:55am    
If you dont want to change index of radio button,then i think theres no need to implement radiobuttons at all.Remove it from your page.If its index wont get changed,then its useless.
Pratik Gaikwad 16-May-13 1:06am    
I am can select either of them using Mouse... I just want to prevent selection using Keyboard...
Sergey Alexandrovich Kryukov 16-May-13 0:57am    
What do you mean by radio button index? It is checked or not, one control in a group.
—SA
Pratik Gaikwad 16-May-13 1:07am    
I am can select either of them using Mouse... I just want to prevent selection using Keyboard, specially arrow keys.
Sergey Alexandrovich Kryukov 16-May-13 1:14am    
No. If you break consistency between mouse and keyboard, you break user trust. I call it UI crime.
Honestly, anyone who would experience this "functionality" will never come back to your site.
And your idea has no purpose at all, nothing useful; your explanation of this "need" is simply ridiculous. The user know what key to press.
—SA

1 solution

Do yourself a great favor: don't try to do it. It would render radio buttons useless and drive your users crazy.

—SA
 
Share this answer
 
Comments
Member 10270066 10-Jan-14 10:27am    
useless? Do you not use a mouse?
Sergey Alexandrovich Kryukov 10-Jan-14 17:34pm    
You note is irrelevant to your problem. If you limit functionality of some control that badly, you render it useless. It is designed to be controlled by a mouse and keyboard. You should not deprive the users of their natural rights. Don't do evil.
—SA
Pratik Gaikwad 11-Jan-14 3:00am    
@SA and people sometimes requirement come from clients. I am just a developer and has to fulfill the requirements from client. So please do yourself and everybody on code project community a favor, don't put comments if you don't have a proper, helpful, useful suggestion or solution.
Don't waste unnecessary time and energy of somebody by saying things like Don't do evil. The question I asked was solvable and I managed it. So My request to whoever admin is please ask the members to prevent commenting like this to someone else who is trying or asking something weird.
Sergey Alexandrovich Kryukov 11-Jan-14 12:08pm    
Let me decide by myself on what to comment or not. I also do know what to waste my time on and what not. We support here the freedom of speech; why do you think that my comment (actually aimed to give you real help) is inappropriate, and yours (where you trying to limit my help) is not? My advice is supposed to warn you against wrong and destructive solution. As a developer, you have the obligation to speak up on requirements and discuss the issues in your team, to prevent wrong action, not just do what other tells you; you are not supposed to become a robot. Please rethink your behavior. Don't do evil.

Thank you for understanding,
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900