Not allowing user to enter invalid data.

If I have a field which is supposed to take only ‘number’ data. How can I prevent user from entering any character ? I read about validation but its not working in my case.

Instead of displaying that entered character is invalid. I want to prevent user from entering wrong character. (Something like a field supposed to take only number wont take any char i.e nothing will be displayed if user enters a char). Is it possible…?

IF not how does that ‘rules’ work ? Does it display any message later ?

Hello,

there is not functionality to set onkeypress event handler. In the next version we’ll possibility to get input object. So, you could set custom handlers to the input.

The data are validated on validate() call.

you may set onValidationError and onValidationSuccess event handlers for the form. These events takes input id and object with form data as parameters.

To highlight an invalid input you need to define .dhx_inp_text.invalid css class:

.dhx_inp_text.invalid{
background-color:#ff9999;
}