EasyUI Forum
May 21, 2024, 03:18:22 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [Solved] Disable move to next input field in form by tab  (Read 1054 times)
Wojak
Newbie
*
Posts: 48


View Profile Email
« 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.
« Last Edit: July 17, 2023, 11:00:32 AM by Wojak » Logged
Wojak
Newbie
*
Posts: 48


View Profile Email
« Reply #1 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;
                }
            }
        }
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!