the text field should not allow more than 6 digits before the decimal and not more than 2 digits after decimal, i.e I should not be able to enter 7th digit before the decimal and 3rd digit after the decimal.

for this I can't use maxsize and enforcemaxlength attributes because it will only support integer precision not floating precision.

I tried the below code implementing keydown and keyup events and using the substring functionality but its not working
keydown :
function( textfield , e,eOpts ) {