Allow/Refuse certain values as they are entered in a form
Posted on 2003-03-26
I would like my program to be able to allow or refuse certain values as they are entered by the user.
For example, when the user has to enter an "IP Address" in the appropriate field, I would like my program to refuse it if he tries to type in anything other than numbers (i.e. letters).
This can be done either by not accepting the entry at all (as if the keyboard is jammed, with a beep sound), or by accepting initially the value and then performing a verification on the string/value entered and then displaying an error message asking the user to reenter again the value.
I would prefer the first solution, cause it forces the user to enter the right values from the begining.