showing results for - "disable paste space in textbox using javascript"
Margaux
11 Jan 2018
1// don't allow paster space from another source
2restrict_allow_paste_space: function($ele){
3  $ele.on('keypress', function(e) {
4    if (e.which == 32){
5      return false;
6    }
7  });
8  $ele.on('paste', function(e) {
9    e.preventDefault();
10  });
11},
12  
13  
14// don't allow space when type username
15<input type="search" name="username" id="login-username" class="form-control a4l-input"  onKeyDown="if(event.keyCode === 32) return false;" placeholder="<?php echo  __d('member', 'enter_usename')?>">
16