Control characters in js-grid field

1

I need to be able to control that in a field of the grid they do not allow to enter characters like !@"#$%&/()

already modify the function in this way using the RegEXp option

$str_eventUpdating=',onItemUpdating: function(args)
                {   
                      var grupo_promocion;
                      var c_barra;
                      var pattern =  new RegExp(/^[^!@"#$%&\/()]*$/);

                      c_barra=args.item.c_barra;
                      grupo_promocion=args.item.grupo_promocion;

                    if (args.item.grupo_promocion === null || args.item.grupo_promocion == "" ) {
                        grupo_promocion="";
                    }   

                    if(pattern.test(document.getElementById("grupo_promocion"))){
                          alert("No se permite ingresar caracteres como @ # & %")
                          args.cancel = true;
                    }else{
                           updategpromocion(c_barra,args.item.grupo_promocion); 
                          alert("Se actualizo el grupo de promoción correctamente")
                    }

                }

          ';

but I still see the control if I enter normal number and letters

    
asked by Norbey Martinez 05.04.2017 в 17:30
source

1 answer

0

Within the function of onItemEditing , I recommend using

answered by 05.04.2017 в 17:40