Page 1 of 1

Check if editbox contains only digits.

Posted: Wed Mar 08, 2006 5:48 am
by Treoxx
I like to check if a editbox is filled, only with digits.

I could use the MaskEdit function, but I just do not want to set a defined number of digits. The MaskEdit is nice to set a telephone number format but not for just some digit checking.

I can write some code for it but I thought, first lets ask if there is another simple option to do it.

Thanks!

Posted: Wed Mar 08, 2006 12:03 pm
by MichaelNesmith
You could use a mask of the form:

"999999999999999999999999999999999;0; "

Where you add more 9s if necessary. The mask is to be entered without quotes and has a final space at the end. It permits entering as long an integer as there are 9s. But it does not require them all to be entered.

This will allow a free-floating size edit box which will accept only integers. And in the script you can use Parse String to remove all the spaces which will be used as fillers after the last number that was entered.

Posted: Tue Mar 28, 2006 4:05 am
by Treoxx
The next problem:

I have 3 MaskEdit boxes where a time has to be set.
When typing a time in the first MaskEdit box the focus jumps straigt to the next Maskedit box after one digit.

The mask is: 99:99;9;

Posted: Tue Mar 28, 2006 3:48 pm
by MichaelNesmith
You probably set the MaxLength field to one. Set it to something bigger. This field auto tabs to the next field when the indicated length is typed in. Set it to 0 to turn this feature off.

Posted: Wed Apr 05, 2006 4:19 am
by Treoxx
If I set the edit mask to 99:99;9; the MaxLength is auto. set to 5.
And the maxlength is not changeble after put in a edit mask.
Any idea what else it can be?