The code segment below is showing promise at allowing only digit entries...and some promise for limiting the number of digits to two per field.
It's interesting to me that the error alert about more than two digits pops up only as the 4th digit is keyed,
not when the 3rd one is keyed

??
While the focus is properly returned to the offending field,
the re-displayed field then shows just one digit, not the three originally showing when the alert pops up.
[CODE]
Rebol[Title: "
www.lotterychecker.com"]
key-event: func [face event] [
if event/type = 'key [
ch: event/key
if ch = 'left [return event]
if ch = 'right [return event]
if ch = #"^-" [return event]
if not find "0123456789" ch [alert "Only digits can be entered" return none]
test-box num1
test-box num2
test-box num3
test-box num4
test-box num5
test-box num6
test-box num7
]
if event/type = 'close [
print "Removing event function"
remove-event-func :key-event
]
RETURN event
]
test-box: func [numbox] [
if (3 = length? numbox/text) [alert "Entry box allows only two digits" focus numbox
show face return none]
]
insert-event-func :key-event
lotto-layout: layout [backdrop green across tab tab
title red "
WWW.LOTTERYCHECKER.COM"
below
style numbox field 30x30 font [size:35]
h1 {A tool with which you store, manage and check groups of
lottery ticket numbers:} across
h1 blue "Select the game you wish to work with here --->"
game: choice 200x45 "PowerBall" "New York Lotto" "Thunderball" "MegaMillions"
return below
h2 {Indicate the function you wish to perform by clicking one
radio button below:}
across tab
radbutchk: radio h2 blue {Check the winning number below against all my tickets:}
return tab
radbutadd: radio h2 blue "Add number below to my file for this game"
return tab
radbutdel: radio h2 blue "Delete number below from my file for this game"
return tab
radbutver: radio h2 blue "Verify number below is on file for this game"
return tab
radbutlst: radio h2 blue {List all numbers for this game (no number need be entered
below):}
return
below
h2 {Enter (6) two digit numbers below to reflect the requirements of
the game you selected above. Use the last box for entering winning bonus
numbers for N.Y. Lotto, UK Nat'l. Lottery:}
across
num1: numbox "00" tab
num2: numbox "00" tab
num3: numbox "00" tab
num4: numbox "00" tab
num5: numbox "00" tab
num6: numbox "00" tab
num7: numbox "00"
return
box red 700x3 return
tab tab button 96x45 font [size: 25] "GO !!"
tab button 96x45 font [size: 25]"Reset" [clear-fields lotto-layout show lotto-layout]
]
focus num1
view lotto-layout