HI,

I want to define short keys (access key) for button and radiobutton list,checkbutton list in my page.It is working fine for simple radio button and checkbox but it is not working for radiobuttonlist and checkbox list.
How to add access keys for Checkbox list and radiobutton list.

thanks.

Since CheckBoxList and RadioButtonList are group controls, you can only set an AccessKey for the group as far as I'm aware. In other words, you can set it for the list, but not for items within the list. Hope this helps explain.

Detect the window.keycode event in javascript. If they hit the combination you wish, use javascript to "check" the box or radio button.

Here's a simple link for you. Detect the key codes pressed. If they hit alt and R, then check the correct box:

if (document.getElementById("radiobtnID")) document.getElementById("radiobtnID").checked = true;

Here's the link:

http://www.htmlgoodies.com/beyond/javascript/article.php/3471141

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.