Only allow digits in dialog box field...
Posted: Wed Nov 02, 2016 9:00 am
Is there a way to limit user input to digits only when they are presented with a dialog box?
I use this code to limit input to digits for a text field
Is there a similar way to limit user input on a dialog box?
Thanks for any suggestions or advice,
TJ.
I use this code to limit input to digits for a text field
Code: Select all
on keyDown pKey
put cr & "1" & cr & "2" & cr & "3" & cr & "4" & cr & "5" & cr & "6" & cr & "7" & cr & "8" & cr & "9" & cr & "0" into tAllowed
if pKey is not in tAllowed then
answer "Entries can only contian NUMBERS" with "OK"
else
pass keyDown
end if
end keyDown
Thanks for any suggestions or advice,
TJ.