I am using telerik (version 2012.2.724.35) .In my page i have an radupload and an next button. I want to make it accessible through Keys To achecive this i added Below code on OnClientAdded event of Radupload control But it didn't work Properly.
function
keyboardSupport(sender, args) {
var $fileInput = $(args._fileInputField);
var $fakeInput = $fileInput.nextAll("input[class='ruFakeInput']");
var $selectButton = $fileInput.nextAll("input[class='ruButton ruBrowse']");
$selectButton.attr(
'aria-required', 'true');
$fileInput.attr(
'aria-required', 'true');
$(
'label[for$="_DocumentFileUploadfile0"]').text('<%=GetLocalResourceObject("UploadDocumentLabelResource.Text") %>');
$fakeInput.attr(
"tabindex", "-1");
$selectButton.attr(
"tabindex", "-1");
$fileInput.focus(
function(e) {
$selectButton.css(
"border", "1px dotted");
});
$fileInput.blur(
function(e) {
$selectButton.css(
"border", "0px");
});
if (navigator.userAgent.indexOf("MSIE") != -1) {
$fileInput.keydown(
function(e) {
if (e.keyCode == Sys.UI.Key.space) {
$fileInput.click();
}
if (e.keyCode == Sys.UI.Key.enter) {
e.preventDefault();
}
if (e.keyCode == Sys.UI.Key.tab && e.shiftKey == false) {
$fakeInput.focus();
}
if (e.keyCode == Sys.UI.Key.tab && e.shiftKey == true) {
var $checkbox = $(".ruCheck", args.get_row());
if ($checkbox[0] != undefined) {
e.preventDefault();
$checkbox.focus();
}
else {
$fileInput.parent().focus();
}
}
});
}
I want that it should prevent enter key and upload doc on space bar . Above code works fine till upload of doc But after dialogue box opens and i uploaded doc now if i press tab ideally it should go to next control in my case which is another next button but its not working like this it.after doc upload if i press tab it remains in upload control and if press tab twive it go to next button and then if i press enter key it dnt do postback but it clears uploaded file and remain focused in upload control.
I tried changing EnableFileInputSkinning property also it doesnt help.
one more thing if i use $selectButton.click() in place of $fileInput.click(); it works fine in IE9 but in IE8 and IE7 dialogue box doesnt open.
Thanks in advance