I am creating a keyboard shortcuts for various actions on a page that uses the Telerik toolbar. In particular, I want Ctrl+S to save the inputted form info. There is already a Save button on our toolbar, so we want to just use a script to generate a click on that button rather than reconstruct the POST manually (which would be quite complicated). I am using John Resig's jQuery hotkey plugin, which is what is handling the bind statement. In all browsers, the selection of the Save button element or any of the related divs works.
The click registers perfectly in Firefox and IE9, but in Chrome the click does not work at all. Why might this be? The actual code is within a product that I can't really replicate here, but I've made a dummy page to the same effect. Here are the relevant snippets:
JS:
ASPX:
The click registers perfectly in Firefox and IE9, but in Chrome the click does not work at all. Why might this be? The actual code is within a product that I can't really replicate here, but I've made a dummy page to the same effect. Here are the relevant snippets:
JS:
(
function
($) {
$(document).ready(
function
() {
$(document).bind(
'keydown'
,
'ctrl+s'
,
function
() {
$(
"div#RadToolBar .rtbOut"
).click();
return
false
;
});
});
})(jQuery);
ASPX:
<
div
class
=
"save-button"
>
<
telerik:radtoolbar
id
=
"radToolBar"
runat
=
"server"
cssclass
=
"toolbar"
>
<
items
>
<
telerik:radtoolbarbutton
navigateurl
=
"~/default.aspx"
postback
=
"false"
text
=
"Goto Default Page"
causesvalidation
=
"false"
/>
</
items
>
</
telerik:radtoolbar
>
</
div
>