2016-03-17

Meteor - How to supress invalid characters entered in a textbox (Meteor event/jQuery)

"keyup .CLASS_OR_JQUERY_SELECTOR": function( evt ){

  evt.currentTarget.value =
    evt.currentTarget.value.replace(
      /[^a-zA-Z0-9]/g      , function(str) {
        console.log( 'Illegal character typed: [" ' + str + '].' );        return '';      }//function    )//replace  ;//value
}//keyup

No comments:

Post a Comment