Aquib Shahbaz's Profile

About

 
Points: 1
Gender: Male
Birthday: January 15, 1995
Relationship: Single

Pages

Contact

 

Drop files in here
or click to pick manually
Aquib Shahbaz
August 4, 2017 · Public

can anyone help me regarding this.
i want to check the checkbox with enter key.

window.displayBoxIndex = -1;
var Navigate = function (diff) {
displayBoxIndex += diff;
var oBoxCollection = $("#navTable tr");
if (displayBoxIndex >= oBoxCollection.length) {
displayBoxIndex = 0;
}
if (displayBoxIndex < 0) {
displayBoxIndex = oBoxCollection.length - 1;
}
var cssClass = "navBox";
oBoxCollection.removeClass(cssClass).eq(displayBoxIndex).addClass(cssClass);
}
$(document).on('keypress keyup', function (e) {
if (e.keyCode == 13) {
//alert("hello");
$('.navBox').trigger('click');
$("input:checkbox").click();
return false;
}
if (e.keyCode == 40) {
//down arrow
Navigate(1);
}
if (e.keyCode == 38) {
//up arrow
Navigate(-1);
}
});


Aquib Shahbaz
October 19, 2015 · Public

HTML5
947 Followers