LiveCode Text Field That Accepts Only Numerals

Back To LiveCode Main Page

Below is the keyDown subroutine you would need to insert into your text field object to filter out characters that are not numerals.

on keyDown pKeyName
if pKeyName is a number then
pass keyDown
end if
end keyDown




# Check if last keystroke was a numeral…
#...
if it was a numeral then pass it on to be inserted…
#...into the text field.