Simranjeet Singh February 2016

press Enter in td then pressing tab key

<div id="UniDataInt">
    <table class="table table-bordered" id="uniResult">
        <td contenteditable="true" onfocus="showEdit(this);" class="highlight-border">hello</td>
        <td contenteditable="true" onfocus="showEdit(this);" class="highlight-border">hello1</td>
        <td contenteditable="true" onfocus="showEdit(this);" class="highlight-border">hello</td>
    </table>
</div>

This is my Jquery code:

$('#UniDataInt').on('keyup', 'td', function() {
    if (e.keyCode == 13)
        return e.keyCode = 9;
});

Answers


Mahdi PST February 2016

Try following

$(document).ready(function(){
    $('#UniDataInt').on('keydown', 'td', function(e) {
        if (e.keyCode == 13){
            e.preventDefault();
            $(this).next().focus();
        }
}); });

Post Status

Asked in February 2016
Viewed 1,961 times
Voted 9
Answered 1 times

Search




Leave an answer