Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
on openField
mobileSetKeyboardType "numeric"
end openField
on returnInField
beep
exit to top
end returnInField
on commaInField
beep
exit to top
end commaInField
on spaceInField
beep
exit to top
end spaceInField
end keyDown
Just to elaborate, the engine sends different messages when things happen. One of the engine messages is enterInField which is sent when the enter key is pressed in the field. There is no such message for comma, or most alphanumeric keys. So you need to use the more generalised messages as Jean-Marc says.
Thanks for all your replies. But I don't understand from the example what I'm supposed to replace my present script with, other than I presume the "abc" is the field name.
Thanks
Dave
Thanks and whilst is now working OK. Is there a way to remove the incorrect characters whilst still in the field other than doing a manual delete?
Dave
davidmills wrote:Thanks and whilst is now working OK. Is there a way to remove the incorrect characters whilst still in the field other than doing a manual delete?
Dave
on openField
mobileSetKeyboardType "numeric"
end openField
on returnInField
beep
exit to top
end returnInField
on keyup pKey
if pKey is in ", " then
beep
else
put pKey
end if
end keyup