EasyUI Forum
December 08, 2024, 04:29:31 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 2959 times)
Wojak
Jr. Member
**
Posts: 62


View Profile WWW 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
Jr. Member
**
Posts: 62


View Profile WWW 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!