我有一個網格視圖控件在該網格視圖控件ItemTemplate我已經採取了文本框現在我想要做的是,按下箭頭鍵的光標是在第一行的第一個文本框會去第二排如何使用箭頭鍵在ASP.NET Gridview中上下移動
這就是我想做的上下
我有一個網格視圖控件在該網格視圖控件ItemTemplate我已經採取了文本框現在我想要做的是,按下箭頭鍵的光標是在第一行的第一個文本框會去第二排如何使用箭頭鍵在ASP.NET Gridview中上下移動
這就是我想做的上下
使用此URL,它與代碼網格視圖中的第一個文本框。 Navigating through text input fields using arrow keys and return
<script type="text/javascript">
$(document).ready(function(){
// get only input tags with class data-entry
textboxes = $("input.data-entry");
// now we check to see which browser is being used
if ($.browser.mozilla) {
$(textboxes).keypress (checkForAction);
}
else {
$(textboxes).keydown (checkForAction);
}
});
function checkForAction (event) {
if (event.keyCode == 13 || 40) {
currentBoxNumber = textboxes.index(this);
if (textboxes[currentBoxNumber + 1] != null) {
nextBox = textboxes[currentBoxNumber + 1]
nextBox.focus();
nextBox.select();
event.preventDefault();
return false;
}
}
}
</script>
感謝你的迴應這個幫助我很多 – Prashant 2012-03-22 13:15:45
很高興聽到。請投票給我的答案並將其標記爲答案。 – 2012-03-22 13:27:51
使用此URL,它與代碼。 http://stackoverflow.com/questions/6399869/navigating-through-text-input-fields-using-arrow-keys-and-return – 2012-03-22 08:14:36