EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Wojak on July 15, 2023, 12:02:04 PM



Title: [Solved] Disable move to next input field in form by tab
Post by: Wojak on July 15, 2023, 12:02:04 PM
Hi,
How can I disable moving to next input field in form by clicking tab and making '\t' in text field.


Title: Re: Disable move to next input field in form by tab
Post by: Wojak on July 17, 2023, 11:00:02 AM
Code:
inputEvents: {
            keydown: function (e) {
                if (e.keyCode === 9) {
                    e.preventDefault();
                    const val = this.value, start = this.selectionStart, end = this.selectionEnd;
                    this.value = val.substring(0, start) + '\t' + val.substring(end);
                    this.selectionStart = this.selectionEnd = start + 1;
                }
            }
        }