Problem with maxlength restriction with dhtmlGrid in firefox


We are using the below code snippet to restrict the number of characters entered in a particular cell.
mygrid.editor.obj.onkeypress = function(){return mygrid.editor.obj.value.length < 10;}

This is working fine in IE but not in Mozilla Firefox.
Please suggest.


Try to alter your code as

var input = mygrid.editor.obj; if (input.tagName == "DIV") input = input.firstChild; input.onkeypress = function(){return this.value.length < 10;}

We have tried the below code but it didn’t work in any version of firefox.
Please find the below code we are using. The same is working in IE.

dhtml Grid Source