This is my java script to go to next textbox in gridview while pressing enter. But in my gridview it contains textbox, dropdownlist and buttons. So how can I add dropdownlist and buttons to this code. This code only works for textbox inside the gridview.
$(function() {
$("#GridView1").find("input[type='text']").keydown(function(event) {
if ((event.keyCode == 40 || event.keyCode == 13)) {
event.preventDefault();
var td = $(this).parent().next("td");
if (td.length > 0) {
td.find("input[type='text']").focus();
} else {
var tr = $(this).parent().parent().next("tr");
if (tr.length > 0) {
tr.find("td").first().find("input[type='text']").focus();
}
}
}
})
});
Mohammed IbrahimPosted Apr 6, 2016, 12:30 PM
Sivajihero HeroPosted Apr 5, 2016, 7:04 AM