The solution MPDreamz gave should 'prevent' invalid values from being entered into the edit box.

You could use something like this too..
Code:
on *:DIALOG:dialogname:edit:100-110:{
  var %rs 
  if ($regsub(,$did($did).text,/\D/g,,%rs)) beep 1
  did -ra $did %rs
}

(Untested)
Assuming your edit boxes were did's 100-110.

This will allow you to have any length of number (any number of digits). The regsub replaces all \D (non-digits) with null. I used regsub, because it returns the number of replacements made, which lets me /beep 1 when more than 0 replacements were made. Once the \D are replaced, the entire editbox's text value is set to the new value. This should happen so fast that you won't even see the non-digit appear.

-genius_at_work