Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Moving to next textarea in gridview.
Sivajihero Hero
Apr 4 2016 2:32 AM
454
Reply
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.
<script src="https://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(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();
}
}
}
})
});
</script>
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
using win merge tool
export gridview to excel sheel in windows based app